Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).strong text
upon clicking the button "Export to excel" which reads an excel file from a location, adds data into it and gets downloaded which is working fine in Localhost,but giving the above exception once hosted.
Please Refer to the code below
Microsoft.Office.Interop.Excel.Application xlexcel;
Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet;
protected void Btn_EXcel_Click(object sender, EventArgs e)
{
xlexcel = new Excel.Application();//Exception is occuring in this line
.
.
.
}
User contributions licensed under CC BY-SA 3.0