GetObject instead of CreateObject

Bill Tutt billtut at microsoft.com
Mon Jan 31 19:14:29 EST 2000


What VB's GetObject does:
Well, it does two things, so I'll explain both. ;)

1) GetObject(Class := "ProgID") will connect you to an already existing
instance of a COM object.
2) GetObject("c:\blah.xls") is the COM moniker syntax.

In the latest Win32 extenstion bits at:
http://starship.python.net/crew/skippy/

There are three new functions in win32com.client to help you mimic the 
required behavior.

GetObject(): Cheesy VB double purpose crap.
GetActiveObject("ProgID"): Connects you to a running instance ONLY if it
exists.
  I think it throws a com_error exception if the ProgID isn't currently
running.
Moniker("c:\blah.xls"): Instantiates the appropriate COM object given the
passed in   
  moniker.


Bill




More information about the Python-list mailing list