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.
According to this article http://support.microsoft.com/kb/973736 for security reasons Microsoft has introduced this from Office 2010 onwards, and there is no other way to do this other than setting
the folder as a trusted location.