I have been trying to getSDK working in IIS 7 under the NETWORK SERVICE account. What I want to do is to convert a Office document (Word, Excel, txt, etc.) to an image in a ASP.NET web service. The web service runs under the standard NETWORK SERVICE account in IIS7. I followed the example 4 listed on the web page
but I got the following error in doc2pdf.log,
CreateProcessAsUser() failed, GetLastError() = 6
OpenWindowStation() failed, GetLastError() = 5
I was able to resolve the error above by adding the NETWORK SERVICE account to the Administrators group on the web service server but we will NOT be allowed to do that on our customers' servers... The interesting thing was that even if I did not get any error in doc2pdf.log after making the NETWORK SERVICE account an administrator on the server the conversion still did not work until I made all the changes listed on the web page
on the server. I have not tried the example 6 and example 7 listed on the web page
yet. But the approach of the example 6 would not be an option for our customers. And I think I would get the same error above with the example 7.
The same code works perfectly in a console application that runs under the current Windows logon user on the web service server.
Any advice as to how I could make this working is greatly appreciated.
Thanks for your message, this is a limitation of MS Office application. 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, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when run in this environment.
INFO: Considerations for Server-Side Automation of Office
So, if you wish run the conversion from NETWORK SERVICE account, you will have to set MS Word DCOM, MS Excel DCOM run inside an interactive user account, if you don't know how to do, please refer to the changes on the http://www.verydoc.com/doc-to-any-faq.html web page.