0
我试图从excel vba使用按钮单击运行autoitscript。从Excel VBA运行Autoit脚本
我想从excel工作表运行notepad1.au3脚本。
我将脚本复制到excel表单所在的目录中。
我写了下面的vba代码来运行脚本。一切看起来都很好,它精确地采用了路径文件名等。
但不是只运行该脚本,而是弹出一个资源管理器窗口,要求我找到要运行的脚本。
我可以通过资源管理器窗口浏览脚本的位置并选择脚本文件,它会运行。
但我希望它运行时无需打开资源管理器窗口。
任何想法可能是什么问题?
感谢
VBA代码:
Sub Autoit()
Dim AutoItPath
Dim FileName As String
Dim FileName1 As String
FileName = ThisWorkbook.Path & "\notepad1.au3"
MsgBox (FileName)
AutoItPath = "C:\Program Files (x86)\AutoIt3" & "\AutoIt3.exe "
MsgBox (AutoItPath)
FileName1 = """" & AutoItPath & """" & """" & FileName & """"
MsgBox (FileName1)
runscript = Shell(FileName1)
End Sub