5

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.

3
  • 1
    Your version of Office is 64 bit? Aug 6, 2014 at 18:40
  • @DavidBrabant, the Windows Server 2008 R2 I am running powershell from doesn't even have office. Once I can generate the file, then I can send it in email
    – Glowie
    Aug 6, 2014 at 18:46
  • @DavidBrabant --- if you post your question as an answer I will mark it as a solution, because it gave me idea to install Office
    – Glowie
    Aug 6, 2014 at 19:38

2 Answers 2

8

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

2

I installed Office 2007 on the server and it now works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.