I'm trying to call a PowerShell script from a macro in Excel.
I have seen a number of examples along the lines of:
retval = Shell("powershell ""C:\MyTest.ps1""", 1)
When I try to use this, however:
Sub Connect_01() Dim x x = Shell(“powershell.exe ""\\corp\hdq\Path with spaces\PowerShell\Modules\macro01.ps1""", 1) End Sub
I get a compiler error:
If I remove the assignment, I get the error at the first pair of quote marks:
Expected: list separator or )"
As I don't have much experience with VBA, and none with the Shell() command, any help would be appreciated.