Hello.
I have a forms application in C# and Visual Studio. This app interacts with Excel and is working fine.
I installed the executable and the configuration file in another computer and when the app calls excel I received a message stating that a library was not registered. The error message says that it's not possible to convert a COM object type 'System.___ComObjet' into the interface 'Microsoft.Office.Interop.ExcelApplication'. My Visual Studio is Community 2019.
Does anyone know what to do to correct it? Which DLL should be copied too to correct it? Or which files should be copied too?
Loading
Uehara AyakaPosted Aug 30, 2021, 1:10 AM
Alternatively, you can use Spire.XLS for .NET to create, edit, and save Excel documents without dependency on MS Office. In other words, you do not need to install MS Office on either developer's or client's computers.
https://www.nuget.org/packages/Spire.XLS/
Ismael OliveiraPosted Sep 2, 2021, 7:48 PM
Arnab MukherjeePosted Aug 27, 2021, 12:04 AM
Hi, This problem is mostly caused by incorrect COM Interop settings in the Windows registry. This can be caused by installing a newer version of Microsoft Office, and then removing it and installing an older version instead.This issue can be resolved by deleting an invalid registry key left over from the higher version of Office.Please follow steps below.
Start-->Run --> regedit --> HKEY_CLASSES_ROOT-->TypeLib-->{00020813-0000-0000-C000-000000000046} --> 1.8/1.7 (Delete this)
or you can completely uninstall, reboot, and then reinstall your Microsoft Office programs.