V.S 2015: Interface to Excel from C#: Exception

  • Thread starter Thread starter Z. V
  • Start date Start date
Z

Z. V

Guest
Hello,

The following C# is used to initiate an interface to EXCEL:


using Excel = Microsoft.Office.Interop.Excel;

xlApp = new Microsoft.Office.Interop.Excel.Application();
xlWorkBook = xlApp.Workbooks.Add(System.Reflection.Missing.Value);


I have a windows 7 PC in which it works fine.

On another windows 7 PC I got the following exception:

Additional information: Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

Both PCs contains a working V.S 2015 IDE.

Thank you in advance,

Zvika

Continue reading...
 
Back
Top