I am trying to generate an excel file from my database it working locally but when I try to run it on IIS its giving me this error:
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.
Here is the code that I am using
Microsoft.Office.Interop.Excel.ApplicationClass ExcelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();
Microsoft.Office.Interop.Excel.Worksheet ExcelWorkSheet = new Microsoft.Office.Interop.Excel.Worksheet();
Microsoft.Office.Interop.Excel.Workbook ExcelWorkbook = null;
try
{
List<Information> InfoList = InfoManager.GetAllInfo);
.......
}
It is always giving me an error on
Microsoft.Office.Interop.Excel.ApplicationClass
ExcelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();