Search code examples
excelpowershell64-bit

Error "Retrieving the COM class factory for component with CLSID" when starting Excel


I am running PowerShell on 64-bit machine. The line

$excel = New-Object -ComObject Excel.Application

gives the 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 researched and tried to run powershell_ise.exe from

C:\Windows\SysWOW64\WindowsPowerShell\v1.0

as explained here, but I still get the error.


Solution

  • Well, here it is then: you have to install Office 64bit.