Retrieving the COM class factory for component with CLSID

Occasional Visitor

Hi,

I need to move an old script from old server to new one. Getting following error when I run below code.

$file = New-Object - ComObject Excel.Application

 

Error : New-Object : Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed due to the following error: 80040154
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

 

I tried installing Excel package for PowerShell. Can someone guide what else might be missing or needs to be installed since it's brand new server?

 

Thanks! 

1 Reply

Hello @Newbee321,

AFAIK you need to have Microsoft Excel installed on the server to create a COM object.

 

Hope that helps.