且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过Excel VBA运行Powershell脚本

更新时间:2023-02-03 20:35:58

如果文件路径中有空格,则需要在其两边加上引号.

If your file path has spaces you need to put quotes around it.

x = Shell("POWERSHELL.exe -noexit " & _
           """H:\Operations\REPORTS\Reports2018\Balance Sheet\SLmarginJE.ps1""", 1)