Excel Object Creation Issue

I have a script used to create new projects. Within it, I create an Excel object subsequently used by the New-PWRichProjectsFromSpreadsheet cmdlet. It's worked with no issue until recently when the New-Object -ComObject excel.application started throwing this error:

New-Object : Creating an instance of the COM component with CLSID {00024500-0000-0000-C000-000000000046} from the IClassFactory failed due
to the following error: 80010108 The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108
(RPC_E_DISCONNECTED)).

What's odd is that if I attempt to run the line manually a second time it will succeed and create the object.  PS is running as admin.

Any ideas why it may be failing?

Parents Reply Children