after some research this is the code that work
note : i run this code from Powershell so you have to save it in a '.PS1' file to run it![]()
# start Excel $excel = New-Object -comobject Excel.Application #open file $FilePath = 'E:z.xlsm' $workbook = $excel.Workbooks.Open($FilePath) #make it visible (just to check what is happening) $excel.Visible = $true #access the Application object and run a macro $app = $excel.Application $app.Run("a")
Bookmarks