Python + COM problem. :(

I

Ixokai

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...
<COMObject Word.Application>

But as soon as I shut word down...
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "Z:\Python23\Lib\site-packages\win32com\client\__init__.py", line 95,
in Dispatch
dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "Z:\Python23\Lib\site-packages\win32com\client\dynamic.py", line 84,
in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "Z:\Python23\Lib\site-packages\win32com\client\dynamic.py", line 72,
in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
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
 
M

Mark Hammond

Ixokai said:
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.

It is a problem specific to that machine then! Check that there aren't
any "phantom" word processes still running - use the Task Manager.

Otherwise, use the Office CD to 'repair' the installation.

Mark.
 
I

Ixokai

Well, yes, I know its specific to that machine.. i said that :) I just
thought it might have something to do with something wrong w/ my python
installation, since i've tried a repair-- reboots-- and reinstallations of
Office, all to no avail.

--Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,250
Latest member
Charlesreero

Latest Threads

Top