Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unhandled Exception: System.Runtime.InteropServices.COMException (0x800A03EC)

I have a C# application that exports an Excel file. When I run it from Visual Studio, it is working fine. However, when I schedule it to run from SQL Server Agent, it failed with the following error:

Unhandled Exception: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space. To make more memory available, close workbooks or programs you no longer need. To free disk space, delete files you no longer need from the disk you are saving to.

I have searched many links, and they say it could be a permission issue. So I applied the things below per the solutions provided in Stack Overflow, but no luck.

  1. Created directory “C:\Windows\SysWOW64\config\systemprofile\Desktop ” (for 64 bit Windows)

  2. Applied Full control permissions for directory Desktop for my domain user, SQLServiceAgent

I'm using SQL Server 2014 and Win 2012 Edition with MS Excel 2007.

Can anyone help?

like image 848
Mari Avatar asked Feb 26 '16 02:02

Mari


People also ask

How do I fix Hresult 0X800A03Ec?

Typically, Excel Error Hresult 0X800A03Ec errors are caused by a corrupt or missing Microsoft Excel-associated file, sometimes due to malware infection. File replacement is typically the best and easiest way to resolve errors related to Microsoft Corporation files.

What is a COMException?

COMException(String, Exception) Initializes a new instance of the COMException class with a specified error message and a reference to the inner exception that is the cause of this exception. COMException(String, Int32) Initializes a new instance of the COMException class with a specified message and error code.


1 Answers

I tried this and it worked. I found "Microsoft Excel Application" is missing in DCOM Config. So, I did the following steps:

  1. Start
  2. Run
  3. mmc -32
  4. File
  5. Add Remove Snap-in
  6. Component Services
  7. Add
  8. OK
  9. Console Root
  10. Component Services
  11. Computers
  12. My Computer
  13. DCOM Config
  14. Microsoft Excel Application -> Right click -> Properties
  15. On Security tab, give full permissions to the domain user and NT SERVICE\SQLSERVERAGENT on: a. Launch and Active Permissions b. Access Permissions c. Configuration Permissions
  16. On Identiy tab -> change to Interactive User

That's it. I ran the SQL job and it succeeded.

like image 199
Mari Avatar answered Sep 30 '22 09:09

Mari