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.
Created directory “C:\Windows\SysWOW64\config\systemprofile\Desktop ” (for 64 bit Windows)
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?
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.
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.
I tried this and it worked. I found "Microsoft Excel Application" is missing in DCOM Config. So, I did the following steps:
That's it. I ran the SQL job and it succeeded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With