Greetings...
I'm working on automating Word, and have run into an interesting problem on
one workstation. If Word is not already running, then I can't run the
'Dispatch' to get the word application. On my PC at work, that's not the
case.
For example.. With word running...
[color=blue][color=green][color=darkred]
>>> import win32com.client
>>> win32com.client .Dispatch("Word .Application")[/color][/color][/color]
<COMObject Word.Applicatio n>
But as soon as I shut word down...
[color=blue][color=green][color=darkred]
>>> win32com.client .Dispatch("Word .Application")[/color][/color][/color]
Traceback (most recent call last):
File "<interacti ve input>", line 1, in ?
File "Z:\Python23\Li b\site-packages\win32c om\client\__ini t__.py", line 95,
in Dispatch
dispatch, userName =
dynamic._GetGoo dDispatchAndUse rName(dispatch, userName,clsctx )
File "Z:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line 84,
in _GetGoodDispatc hAndUserName
return (_GetGoodDispat ch(IDispatch, clsctx), userName)
File "Z:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line 72,
in _GetGoodDispatc h
IDispatch = pythoncom.CoCre ateInstance(IDi spatch, None, clsctx,
pythoncom.IID_I Dispatch)
com_error: (-2147024770, 'The specified module could not be found.', None,
None)
Now, at work, when I called Dispatch, it'd just launch a copy of word
(hidden). So, I'm not sure what i'm doing wrong :)
Thanks for the help!
--Stephen
I'm working on automating Word, and have run into an interesting problem on
one workstation. If Word is not already running, then I can't run the
'Dispatch' to get the word application. On my PC at work, that's not the
case.
For example.. With word running...
[color=blue][color=green][color=darkred]
>>> import win32com.client
>>> win32com.client .Dispatch("Word .Application")[/color][/color][/color]
<COMObject Word.Applicatio n>
But as soon as I shut word down...
[color=blue][color=green][color=darkred]
>>> win32com.client .Dispatch("Word .Application")[/color][/color][/color]
Traceback (most recent call last):
File "<interacti ve input>", line 1, in ?
File "Z:\Python23\Li b\site-packages\win32c om\client\__ini t__.py", line 95,
in Dispatch
dispatch, userName =
dynamic._GetGoo dDispatchAndUse rName(dispatch, userName,clsctx )
File "Z:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line 84,
in _GetGoodDispatc hAndUserName
return (_GetGoodDispat ch(IDispatch, clsctx), userName)
File "Z:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line 72,
in _GetGoodDispatc h
IDispatch = pythoncom.CoCre ateInstance(IDi spatch, None, clsctx,
pythoncom.IID_I Dispatch)
com_error: (-2147024770, 'The specified module could not be found.', None,
None)
Now, at work, when I called Dispatch, it'd just launch a copy of word
(hidden). So, I'm not sure what i'm doing wrong :)
Thanks for the help!
--Stephen
Comment