REST service cannot access MicroSoft Word via Python

993
1
05-29-2012 11:06 AM
JefferyNighbert
New Contributor
(I posted the original post on the REST API forum as well on Friday: http://forums.arcgis.com/threads/58532-REST-service-cannot-access-MicroSoft-Word-via-Python)

Surely someone out there is creating a report in MicroSoft Word in python executed from a REST service!?!?

My script calls this line to access Microsoft Word (win32com.client.Dispatch("Word.Application")) - but fails.
I can run the script (as myself or the arcgissoc user) on the same server ArcGIS server is using, which tells me Word is on the server. But, when I run the script from the REST endpoint, I get a permissions problem related to the COM. Write permissions are set properly for the arcgissoc user to access the win32com libraries.  There must be some setting in the COM administrator related to Word that the arcgissoc user needs write access too. Maybe?

error message:
line 241, in wordapp = win32com.client.Dispatch("Word.Application") File "C:\Python26\ArcGIS10.0\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "C:\Python26\ArcGIS10.0\lib\site-packages\win32com\client\dynamic.py", line 98, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "C:\Python26\ArcGIS10.0\lib\site-packages\win32com\client\dynamic.py", line 78, in _GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) com_error: (-2147024891, 'Access is denied.', None, None) (-2147024891, 'Access is denied.', None, None)

Thanks,
ryan
Tags (2)
0 Kudos
1 Reply
RyanKelley
New Contributor II
Solution:

Have to add arcgissic user to DCOM config on the arcgis server. Allow permissions to allow local/remote launch, local/remote activation, and loca/remote access permission.

Ryan
0 Kudos