COM Exception:Office has detected a problem with this file. To help protect your computer this file cannot be opened.

Terkunci COM Exception:Office has detected a problem with this file. To help protect your computer this file cannot be opened.

  • 04 April 2012 6:16
     
     

    Hi,

    I am working on a Windows Application wherein I require to create a new excel document in the 'Temp' folder which is subsequently appended to other excel sheets. This feature works fine for Office 03 and 07;however I receive the exception 'COM Exception:Office has detected a problem with this file. To help protect your computer this file cannot be opened.' for 2010 version of office. This exception leads to the failure of the excel sheet creation rendering the further operations useless.

    After some research I found a workaround for this problem as setting the location of the 'Temp' folder as Trusted Location in Excel's Trust Center. However, I would be glad if this can be acheived through the code.

    IDE used: Microsoft Visual Studio 2008

    Please address this issue.

Semua Balasan