NDraskovic
NDraskovic

Reputation: 706

Excel Interop error

I'm having a problem with running an application I made on another computer. This is the error message I'm getting:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154

I searched it on Google, and found out that it means that I need to register that specific component in regedit, but I don't know how to do it, or where to find that component, so please help me.

I used C# in VS 2010 to make my application. One more thing, I don't know if it matters - I installed this application on 3 different computers, and this is the only one that gives me that error - it is a HP all-in-One computer.

Upvotes: 0

Views: 1341

Answers (1)

Hans Passant
Hans Passant

Reputation: 941465

for component with CLSID {00024500-0000-0000-C000-000000000046}

That's the guid for Microsoft Excel's Application class. Two very basic reasons you'll get this error:

  • Microsoft Office is not installed on that machine
  • The machine has a 64-bit operating system and you installed the 32-bit version of Office. You have to force your program to run in 32-bit mode. Project + Properties, Build tab, change the Platform target setting to x86
  • The machine has a 64-bit operating system and you installed the 64-bit version of Office 2010. Same fix as above but now you have to make sure to select the AnyCPU target.

Upvotes: 2

Related Questions