3
我需要实现一个在autoit之后运行并运行完程序的宏,它运行宏的其余部分。 我尝试了Shellandwait(),但是我没有找到解释它的文档。执行AutoIt并等待完成
我把代码,论坛上其他的例子,得到了这一点:
Sub autoit() Dim hProcess As Long Dim xPath As String Dim wsh As Object Dim waitOnReturn As Boolean: waitOnReturn = True Dim windowStyle As Integer: windowStyle = 1 Set wsh = CreateObject("WScript.Shell") xPath = Application.ActiveWorkbook.Path hProcess = wsh.Run("D:\Program Files\autoit-v3\install\AutoIt3_x64.exe " _ & xPath & "\leandro.au3", 0, True) Workbooks.Open (xPath & "\Mudança " & Format(Date, "dd_mm_yyyy") & ".csv") End Sub
当我运行它返回我这个错误:这是什么意思
"Run-time error '-2147024894 (80070002)': Method 'Run' of object 'IWshShell3' failed"
我不知道,我没有创意解决方案