I have WPF application which reads excel file data and display it in on UI. I am using Microsoft.Office.Interop to read excel file data mainly .xlsx. On dev machine application is working fine but intalling and running this app on some computers it giving me this error:
ExcelRetrieving 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)
What could be possible solution for this?
The Interop library has a number of massive disadvantages; the first is that you need a copy of Excel installed on the target machine for it to work.
For this reason, our team never uses it. I’d suggest the following alternatives.
http://npoi.codeplex.com ( older library for MS 2003 files .xls).
http://epplus.codeplex.com ( newer library with easier API that handles 2007 files .xlsx )
Neither requires Excel to be on the server.