我正在尝试从 vba excel 运行一些 powershellscript,它运行正常。但现在我收到系统无法找到文件的错误。
Sub Button1_Click()
strCommand = "Powershell -File ""C:\Users\Sagar.Patro\Documents\Powershell\xyz.ps1"""
Set WshShell = CreateObject("WScript.Shell")
Set WshShellExec = WshShell.Exec(strCommand) *<- debug highlighting this line*
strOutput = WshShellExec.StdOut.ReadAll
End Sub