This project has moved and is read-only. For the latest updates, please go here.

Unhandled Exception when trying to Create Excel document form C# Application

Oct 31, 2012 at 1:21 PM

I am getting the following unhandled exception when I try to create an excel document using my c# application.  This process works fine when I am running the c# application from visual studio 10, but when I try to run the application outside of visual studio using the .exe file this error is appearing.


System.IO.FileNotFoundException: Could not load file or assembly 'ExcelApi, Version=, Culture=neutral, PublicKeyToken=9084b9221296229e' or one of its dependencies. The system cannot find the file specified.
File name: 'ExcelApi, Version=, Culture=neutral, PublicKeyToken=9084b9221296229e'

Oct 31, 2012 at 1:50 PM

the NetOffice assemblies are stored in the same folder? for excel you need NetOffice, ExceApi, OfficeApi, VBEIDEApi
nice to know: Win7? your application has elevated permissions? your application is stored in which folder?


Oct 31, 2012 at 1:59 PM

I have added references for NetOffice, ExcelApi, OfficeApi, and VBEIDEApi.  It is not working on Windows 7 or Windows XP.  I am creating a C# application that will be distributed to users.  The application and the NetOffice Interop work fine to create the Excel file when the application is run from Visual Studio 2010, but it will not work when the application is not run from Visual Studio 2010 but from the applicaiton's .exe file.  The users whom will be receiving this c# application will not have Visual Studio therefore it needs to work externally and by itself.

Oct 31, 2012 at 2:06 PM

is it possible to send your solution to my mail adress? (create a copy and remove critical code of you want)


Apr 5, 2013 at 3:52 PM
It has sth to do with the property 'embed interop type' of the references, so it shopuld be documented, if not done.
First time i am also struggled with it as far as a colleague of mine told me that there are not properly documented entries to be modified