.Net, C#, Technology and tricks

System.Runtime.InteropServices.COMException – Task scheduler – Console application

Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException
Stack:
at Microsoft.Office.Interop.Excel.Workbooks.Open(System.String, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object)
at NotificationReportGenerator.ExcelFactory.ReadExcel(System.String)
at NotificationReportGenerator.Program.Main(System.String[])

The solution for this appalling BUG in Microsoft IIS & Excel is terrific:

  1. Create directory “C:\Windows\SysWOW64\config\systemprofile\Desktop ” (for 64 bit Windows) or “C:\Windows\System32\config\systemprofile\Desktop ” (for 32 bit Windows)
  2. Set Full control permissions for directory Desktop (for example in Win7 & IIS 7 & DefaultAppPool set permissions for user
    “IIS AppPool\DefaultAppPool”)

Leave a comment