Run c# program In Jenkins, cannot save Excel files

Usually get this error:

System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save any more documents

After SaveAs method


to solve this problem do this works:

  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”


See here foe more details:


Show devices which were connected in Device Manager

you need to add a System variable called devmgr_show_nonpresent_devices and set its value to 1

  1. Open Windows System:
    1. Control Panel > System and Security > System, OR
    2. Right-click on Computer > Properties, OR
    3. WinKey + Pause/Break
  2. open Advanced system settings
  3. click on Environment Variables
  4. in System variables click on New…
  5. in Variable name type devmgr_show_nonpresent_devices
  6. in Variable value type 1
  7. click OK on every dialog box
  8. open Device Manager
  9. in View menu, select Show hidden devices