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?
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.