this question refers to following thread:
Open Powershell (EMS) command within VBA Excel
I've still the problem thta i'm getting error message below:
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
File C:\users\username\desktop\settmb.ps1 cannot be loaded because the executi
on of scripts is disabled on this system. Please see "get-help about_signing" f
or more details.
+ CategoryInfo : NotSpecified: (:) , ParentContainsErrorRecordE
+ FullyQualifiedErrorId : RuntimeException
If i start a EMS or Windows Powershell or VBS from Desktop directly it's running
without any problem.
I'm already set "unrestricted" to the 1st line of the script but same error.
The script should be executed from a command button in excel 2010.
Here's the code:
Private Sub CommandButton1_Click()
File = "c:\users\username\desktop
Set cell = ActiveSheet.Range("A12")
' Static content
Set oFile = CreateObject("Scripting.Fi
oFile.WriteLine "Set-ExecutionPolicy unrestricted"
oFile.WriteLine ". 'C:\exchsrvr\bin\RemoteExc
oFile.WriteLine "Connect-ExchangeServer -auto"
While cell.Value <> ""
Set cell = cell.Offset(1)
Shell "powershell -noexit -file " & File
and here the generated *ps1
appreciate for your help