|
3#
楼主 |
发表于 2011-9-1 14:35:16
|
只看该作者
本帖最后由 WANDY 于 2011-9-1 14:38 编辑
回复 2# park_p
感谢Park_P, 已经用AUTOIT脚本暂时解决了该问题。
附上解决代码:
VBA调用函数
- Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
- 'Author:
- 'Create Data:
- 'Description: OpenScript to close Window
- Public Sub OpenScript(DirScriptName)
- Dim ScriptName As String
- ScriptName = getLocalPath + DirScriptName ' this is AU3Script Path
- ShellExecute 0, vbNullString, ScriptName, vbNullString, vbNullString, vbNormalFocus
- End Sub
复制代码
脚本代码如下:
- WinWait("Microsoft Internet Explorer", "") ; Pauses execution of the script until the requested window "Microsoft Internet Explorer" exists.
- If Not WinActive("Microsoft Internet Explorer", "") Then WinActivate("Microsoft Internet Explorer", "")
- WinWaitActive("Microsoft Internet Explorer", "");WinActive window "Microsoft Internet Explorer"
- ControlClick("Microsoft Internet Explorer", "", "[CLASS:Button;INSTANCE:1]","left",1); Click Button which is "INSTANCE:1"
复制代码 |
|