Razvan Melinte
asked on
how to add a message box that can grab the powershell result and prompt it in excel
Hello
I am using a vba code to run a command from excel to Powershell but i need to have a message box with the result of the powershell command.
Below you can find the script that I am using.
Can you please help me ?
file = "c:\users\User\desktop\Set MSXUser.ps 1"
Set cell = ActiveSheet.Range("Y12")
Set ofile = CreateObject("Scripting.Fi leSystemOb ject").Cre ateTextFil e(file)
While cell.Value <> ""
ofile.WriteLine cell.Value
Set cell = cell.Offset(1)
Wend
ofile.Close
Shell "powershell.exe -file " & file
End Sub
Regards
I am using a vba code to run a command from excel to Powershell but i need to have a message box with the result of the powershell command.
Below you can find the script that I am using.
Can you please help me ?
file = "c:\users\User\desktop\Set
Set cell = ActiveSheet.Range("Y12")
Set ofile = CreateObject("Scripting.Fi
While cell.Value <> ""
ofile.WriteLine cell.Value
Set cell = cell.Offset(1)
Wend
ofile.Close
Shell "powershell.exe -file " & file
End Sub
Regards
what do you want the messagebox to say?
ASKER
the information provided by powershell.
if there is any error message, to provide the error message for example.
if there is any error message, to provide the error message for example.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.