|
以下代码在 64位的excle 2021 做申明时可以正常通过,但是到了word2021 vba里,第一行代码就报错报(编译错误:
在 End Sub、End Function 或 End 属性后面只能出现注释)。求解。谢谢
- Private Declare PtrSafe Function setcursorpos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
- Private Declare PtrSafe Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal swextrainfo As Long)
- Private Const mouseeventf_leftdown = &H2
- Private Const mouseeventf_leftup = &H4
- Private Const mouseeventF_Rightdown As Long = &H8
- Private Const mouseeventF_rightup As Long = &H10
- Declare PtrSafe Sub sleep Lib "kernel32" (ByVal dwmilliseconds As Long)
- Public Declare PtrSafe Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long
- Public Type PointAPI
- x As Long
- y As Long
- End Type
复制代码
|
|