
You can run “Power Shell file“!

Use “Run method” of “WScript.Shell object“!
VBA Code
For example, run following “Power Shell file“:
*Show message.
$ws = new-object -comobject wscript.shell
$result = $ws.popup("Run Power Shell file!")
# Normal return code
exit 0
# Error return code
# exit 1

You can run “Power Shell file” by “Run method” of “WScript.Shell object“.
Option Explicit
Sub sampleProc()
Dim psFile As String
Dim wsh As Object
Dim result As Integer
'Set "Power Shell file path"
psFile = "C:\Users\user\Desktop\sample.ps1"
Set wsh = CreateObject("WScript.Shell")
'Run the "Power Shell file"
'Return
'┗0 : Succeeded
'┗1 : failed
result = wsh.Run("powershell -NoProfile -ExecutionPolicy Unrestricted " & psFile, WindowStyle:=0, WaitOnReturn:=True)
If (result = 0) Then
MsgBox ("Succeeded")
Else
MsgBox ("failed ")
End If
Set wsh = Nothing
End Sub
Result
You ran “Power Shell file“

