0

I am on Windows XP and have a 3rd party application that I want to be able to open using a Python script. How do I go about doing it?

from win32com.client import Dispatch
mySuite = Dispatch("TestSuite.Application")

throws an error

File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 312, in RunScript
exec codeObject in __main__.__dict__
File "C:\Documents and Settings\Script1.py", line 2, in <module>
mySuite = Dispatch("TestSuite.Application")
File "C:\Python26\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 98, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 78, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
com_error: (-2147221005, 'Invalid class string', None, None)

Any pointers? Thanks.

1
  • What is this "TestSuite.Application"? Do you have a link to the source, or something? Googling doesn't turn up anything obvious for me. Commented Dec 22, 2009 at 1:16

1 Answer 1

1

Looks like the TestSuite.Application COM class has not been registered -- try opening it in, say, VBScript, to verify, and it should also fail. In which case maybe you can fix it with regsvr32.exe or similar tools.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.