作者:不会遗忘528_757 | 来源:互联网 | 2023-08-18 08:21
Imneedingtoimplementamacrothatrunsafterautoitandfinishedrunningtheprogramitrunsthe
I'm needing to implement a macro that runs after autoit and finished running the program it runs the rest of the macro. I tried the Shellandwait(), but I did not find documentation explaining about it.
我需要实现一个在autoit之后运行的宏,并且运行完程序后运行宏的其余部分。我尝试了Shellandwait(),但我没有找到解释它的文档。
I took other examples of code that forum and got this:
我拿了论坛的其他代码示例并得到了这个:
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
When I run it returns me this error:
当我运行它时返回我的错误:
"Run-time error '-2147024894 (80070002)': Method 'Run' of object 'IWshShell3' failed"
“运行时错误'-2147024894(80070002)':对象'IWshShell3'的方法'运行'失败”
I do not know what it means and I have no idea solution.
我不知道这意味着什么,我不知道解决方案。
1 个解决方案