Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5936353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:23:13+00:00 2026-05-22T15:23:13+00:00

I have a C# WPF (.NET 4.0) application that uses Excel interop to read

  • 0

I have a C# WPF (.NET 4.0) application that uses Excel interop to read data from an Excel file.

When I run this app on my development machine, which has Excel 2007, it works fine. When I run it on another machine that has Excel 2010 installed on it, it fails with the following error message:

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 Class not registered (Exception from HRESULT:0x80040154 (REGDB_E_CLASSNOTREG)).

The failure occurs when attempting to create a Microsoft.Office.Interop.Excel.Application object, as in:

var app = new Application();

My project has a reference to Microsoft.Office.Interop.Excel.dll (version 14.0.0.0, runtime version v2.0.50727), which is located at:

C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14\Microsoft.Office.Interop.Excel.dll

I tried to run the app with the default settings on the referenced dll:

  • Copy Local = False
  • Embed Interop Types = True
  • Specific Version = True

I also tried to run the app with the following settings on the referenced dll:

  • Copy Local = True
  • Embed Interop Types = False
  • Specific Version = True

But on the machine with Office 2010, neither of these attempts worked.

Other notes: The machine with Office 2010 is 64-bit w/ Windows 7. My development machine is X86 with Windows XP.

Question

What is causing the “class not registered” exception and how do I fix it?

Edit

In response to Alex’s answer, I tried building the app as Any CPU, X86, and X64, but it made no difference. I’m still getting the same “class not registered” error.

Edit 2

Just tried the app on a 32-bit machine with Office 2010. No errors. So, it could be something wrong with the particular machine, or it could be the combination of 64-bit and Office 2010.

Edit 3

Okay, so now I’ve tested it on a different 64-bit machine with Office 2010. Again no errors. I think this means something is wrong with the particular machine and it’s not my software’s fault. Ahh programming.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:23:14+00:00Added an answer on May 22, 2026 at 3:23 pm

    Preliminary answer: my software was fine and something was wrong with the setup on that particular machine.

    Edit

    I just found out something that is probably the source of the problem. The problem machine has Office, but it is set up as click-to-run (runs off the internet) rather than MSI-based (runs from an EXE). This means that certain registry settings, DLLs, components, etc. are not available to Microsoft.Office.Interop.Excel, so it fails.

    Edit 2

    That was definitely the problem. Just upgraded to a full MSI-based installation of Office, and everything works great.

    Edit 3

    Added this as a bug to Microsoft Connect:

    https://connect.microsoft.com/VisualStudio/feedback/details/672276/excel-interop-fails-on-machine-where-office-is-installed-as-click-to-run#details

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C# (2008/.NET 3.5) class library assembly that supports WPF (based on
I have a mixed UI (Win App, WPF App, and soon an ASP.NET MVC
Ok another WPF question, well I guess this is just general .NET. I have
I have a WPF .NET 4 application where I override the OnStartup method in
I have a WPF application in VS 2008 with some web service references. For
I have a WPF control, that has a list of Investors, and in the
I am building a C# application that uses a DLL for print. The print
I'm new to WPF, and created a 1st simplistic WPF application that I want
I have a C# application that is having issues using a prepared statement with
We have existing WPF application with complicated graphics (rounded edges of the window, speedometer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.