I am getting the following exception after hosting in IIS

0

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
  .
  .
  .              
}
c#
asp.net
excel
office-interop
asked on Stack Overflow Oct 15, 2018 by Dheemanth Anand • edited Oct 15, 2018 by Dheemanth Anand

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0