All examples that automate Excel through PowerShell start with this line:
PS> $Excel = New-Object -Com Excel.Application
This seems to b
Instead of the usual New-Object -ComObject excel.application us this
New-Object
-ComObject
$excel = [Runtime.Interopservices.Marshal]::GetActiveObject('Excel.Application')
Rest stays the same.
One downside. You will only get the excel "instances" started by the same user that will initiate the ps1.