Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community

Migrating powershell scripts that use com object excel.application

Copper Contributor

I have PowerShell scripts that automate process and loads the result into Excel.  I use the following statement on box where Office16 installed.  After running the below command the $excel variable is filled with information about the object.  When I use the statement on a machine where Office 365 Enterprise is loaded the value of $excel has the structure but no values.

$excel = New-Object -ComObject Excel.Application


I need to understand why this is happening and how to resolve the issue.

0 Replies