how to deploy excel app to server without MS office
Posted on 2009-05-11
I have written a windows service in vb.net to create Excel reports (lot of formatting, calculations ect.,)
The program works file in my PC but not in a server. My PC had been installed Excel 2003, but the server has no any MS Office.
To install my application in the server I generated a setup.exe and msi file and copied them to a folder in the server, and run setup.exe. After running the setup I saw that three dll were added in that folder:
Microsoft.Office.Interop.Excel.dll, Microsoft.Vbe.Interop.Excel.dll, and Office.dll.
Those three dlls should contain all the functions that are necessary for reading data from Excel file. However, the error was generated as soon as the code reaches the following three lines:
Dim myExcel As New Microsoft.Office.Interop.Excel.ApplicationClass
Dim wBook As Microsoft.Office.Interop.Excel.Workbook
Dim wSheet As Microsoft.Office.Interop.Excel.Worksheet
The error message reads
Unhandled Exceptionj: System.Runtime.InteropServices.COMException <Ox80040154>: Retrieving the COM Class factory for Component with CLSID <&> failed due to the following error: 80040154.
Any help would be greatly appreciated.