Suman kumar
Suman kumar

Reputation: 41

Excel interop error- while running from windows service. Microsoft excel cannot open or save any more doc

Hi I have created windows service c# to create an excel file. When I scheduled and running under my id in dev environment it is working fine. But when i run the same service with different interactive Id which is also an administrator account in the server, the service is failing at the line Excel.WORKBOOK.saveas(object) with the below error "Microsoft Excel cannot open or save any more documents because there is not enough available memory or disk space." I have tried many solutions provided in net to provide permissions in comconfig and to create desktop folders in c:\windows\sys32 and syswow64. But still unable to find it.. only with my id the service is running fine but any other interactive if it is failing. Please help

Upvotes: 0

Views: 847

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49443

The Considerations for server-side Automation of Office article states the following:

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.

I'd suggest using the Welcome to the Open XML SDK 2.5 for Office if you deal only with open XML documents, otherwise you may consider using third-party components designed for the server-side execution.

Upvotes: 1

Related Questions