Background
My office has used Office 2010 for quite some time, and I have written an application to generate some Excel files that we upload to a web site. Recently, our company decided to go with Office 365. So, on my development machine I had 2010 and 365 (whatever version that is), as well as Visual Studio 2017.
My company is assuredly going to require that all non-365 versions of office be removed, so today, I uninstalled 2010 to see what breaks.
The Issue
I fixed the references in the project to point to the correct objects now. I have a reference to Microsoft Excel 16.0 Object Library, and I ended up having to modify statements like
Dim ExApp AS Excel.Application= new Excel.Application
to
Dim ExApp AS Microsoft.Office.Interop.Excel.Application= new Microsoft.Office.Interop.Excel.Application
and now the code compiles with no errors. However, when I run it, I get the following error on the above statement:
System.Runtime.InteropServices.COMException: '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)).'
I am not sure why.
Internet searches on that error are typically really old, and most describe trying to run the application on a machine where Office is not installed. I can't run it on my development machine in debug mode.
User contributions licensed under CC BY-SA 3.0