Board logo

標題: [發問] VBA發mail異常 x64 [打印本頁]

作者: yifan2599    時間: 2014-7-11 11:43     標題: VBA發mail異常 x64

各位,我這邊用vba寫自動傳送郵件,但系統為64位元所以出現底下畫面!!
檔案一開啟就出現了~~   不知道有沒有解呢?

Public Declare Function SetTimer Lib "user32" _
        (ByVal hwnd As Long, ByVal nIDEvent As Long, _
        ByVal uElapse As Long, ByVal lpTimerfunc As Long) As Long
Public Declare Function KillTimer Lib "user32" _
        (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

作者: c_c_lai    時間: 2014-7-11 15:28

回復 1# yifan2599
在 Declare 後面加上 PtrSafe 字樣試試看:
  1. Public Declare PtrSafe Function SetTimer Lib "user32" _
  2.         (ByVal hwnd As Long, ByVal nIDEvent As Long, _
  3.         ByVal uElapse As Long, ByVal lpTimerfunc As Long) As Long
  4. Public Declare PtrSafe Function KillTimer Lib "user32" _
  5.         (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
  6. Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
複製代碼

作者: yifan2599    時間: 2015-6-24 11:10

回復 2# c_c_lai


    OK~ 已解決~ 感謝~




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)