I connect COM Microsoft.Interop.Excel through AddReference , choosing from the list. Then I write the method. I use it. All OK. Now I run on a machine where Microfoft Office not installed. The application crashes on stream with a method. I conclude that due to the fact that there is no package installed. I download the library from the Internet Microsoft.Interop.Excel.dll and put it in the project root folder (Release). I delete the old link to the library and now connect it locally (through others - an overview), i.e. I do not choose from the list. I compile. Run on a machine where there is no office. The application now throws an error:

A crash occurred while getting the production of objects of class COM for component CLSID {00024500-0000-0000-C000-000000000046} as a result of the following error: 80040154

What am I doing wrong? And how can you proxy? Is it even possible for an application containing a method that calls work with Excel to work correctly on machines where there is no Office package? (and here and so through local connection of library) Prompt, please. C # WinForms (.NET 3.5), OC Win10

  • 2
    Interop.Excel is a wrapper, i.e. through it there is a call to the COM objects that form Excel, and if they are not available or they are not registered, then it will not work. - Stack
  • @Stack thanks for the clarification. Is it even possible for an application containing a method that calls to work with Excel to work correctly on machines where Office is not installed? - Dmitry Shulga
  • one
    if Excel is not installed, then no. If you need to create or change something in excel- or -word-files, then there is the OpenXML SDK for this - Stack
  • You can also use ADO - Praddos

1 answer 1

The error occurs because Interpop works directly with eksel. Without installed ekselya interaction is impossible.

In order to work on machines without Excel, you need to use external libraries, for example using OpenXML, ClosedXML or other libs.

Not sure, but it is likely that the implementation of the interaction through OleDb will also give the result of possible work without Excel. But I do not give guarantees here.


Update on the issue here: How easy it is to work with / open / change / save Excel / CSV files