[问题] 改用64bit win7后原vba程式出现错误

楼主: writeman (小庄)   2014-06-12 14:56:02
之前在xp office2003上写了一个excel VBA
可以使用ie去点连结后另存新档
在另存新档的画面可以去改档名
部份程式如下
hcombox32 = FindWindowEx(hWnd, 0, "ComboBoxEx32", vbNullString)
hcombox = FindWindowEx(hcombox32, 0, "ComboBox", "")
hedit = FindWindowEx(hcombox, 0, "Edit", "")
SendMessageByString hedit, WM_SETTEXT, Len(fname), fname
hbtn = FindWindowEx(hWnd, 0, vbNullString, "储存(&S)")
而现在改用win7 64bit office 2010后
程式执行到这段程式就会出错
hcombox32 = FindWindowEx(hWnd, 0, "ComboBoxEx32", vbNullString)
请高手们指点一下
谢谢
作者: soyoso (我是耀宗)   2014-06-12 15:19:00
上面是否也有写Private Declare Function FindWindowEx再Declare和Function中间加PtrSafe试试
楼主: writeman (小庄)   2014-06-14 11:50:00
@soyoso 有改过宣告,执行时也没有出现错误讯息,但FindWindowEx就是抓不到资料,传回值hcombox32是0
作者: soyoso (我是耀宗)   2014-06-14 18:40:00
将hcombox32,hcombox用FindWindowEx(hwnd, 0, "Address Band Root", vbNullString)来取代再将取得的hwnd带入FindWindowEx(hwnd, 0, "Edit", "")试试,到hedit有取到值,但不知是否是原po要的
楼主: writeman (小庄)   2014-06-15 23:58:00
请教soyoso大大,那个 Address Band Root 是什么意思?
作者: soyoso (我是耀宗)   2014-06-16 01:20:00
网址列,请看连结 http://goo.gl/5yQI3l

Links booklink

Contact Us: admin [ a t ] ucptt.com