Hello all,
I found this online, and I think it is very close to what I am trying to do, but haven't had much luck in adjusting it to my needs. I am just looking for a way for VBA to open a file. In this case a .PS1 file.
Any help would be greatly appreciated.
I found this online, and I think it is very close to what I am trying to do, but haven't had much luck in adjusting it to my needs. I am just looking for a way for VBA to open a file. In this case a .PS1 file.
VBA Code:
Sub RunAndGetCmd()
strCommand = "Powershell -File ""C:\Users\drew\Desktop\showDSKTP.ps1"""
Set WshShell = CreateObject("WScript.Shell")
Set WshShellExec = WshShell.Exec(strCommand)
strOutput = WshShellExec.StdOut.ReadAll
'MsgBox strOutput
End Sub