The only downside being it won’t help you when working with ancient versions of Excel. Ok so what’s the solution? Well, as it turns out, there is a project called ExcelPackage that will allow us to work with Excel documents without having to worry about Office, Interops, OWC, or anything else! This is due to the use of XML file formats. This is because unlike the developer’s station, the COM object isn’t present on the server (Office cannot be installed on the servers – licensing, security, and performance issues prevent this). Upon uploading the interop to the bin directory, the application will at least then compile, but attempting to work with the interop will result in the second error. The application itself isn’t concerned with the COM object, only the interop assembly. In this case, we are interested in programmatically accessing the functionality of the Excel COM object. NET (the CLR specifically) to leverage unmanaged libraries. If it runs on the developer’s machine, why doesn’t it run on the server?įirst, some background. However this would lead to another error, similar to: Retrieving the COM class factory for component with CLSID įailed due to the following error: 80040154.
#Microsoft office interop excel dll version 12.0.0.0 .dll#
Naturally, they would then assume they needed to upload the .dll file to the bin directory. The system cannot find the file specified. PublicKeyToken=71e9bce111e9429c' or one of its dependencies. While this would indeed work on the developer’s machine, once uploaded to the server, an error such as the following would be thrown: Could not load file or assembly ', Version=12.0.0.0, Culture=neutral, Worksheet myWorkSheet = (Worksheet)myWorkBook.Worksheets Workbook myWorkBook = (XlWBATemplate.xlWBATWorksheet) Protected void Button1_Click(object sender, EventArgs e) Let’s start with the initial creation of the application on a developer’s box with Microsoft Office installed on it. The scenario I outline below is rather common. Populating cells and doing other tasks, while easy enough, would detract from the focus of this post. As OWC is a thing of the past, I’m going to concentrate on interoperability issues and a solution to the problem (more on that later).įor the purposes of these examples, all we are going to do is create a document.
We have noticed an increase in interest from our customers in incorporating Microsoft Excel automation tasks into their ASP.NET applications.