def GetActiveObject(Class, clsctx=pythoncom.CLSCTX_ALL):
 resultCLSID = pywintypes.IID(Class)
 dispatch = pythoncom.GetActiveObject(resultCLSID)
 dispatch = dispatch.QueryInterface(pythoncom.IID_IDispatch)
 return __WrapDispatch(dispatch, Class, resultCLSID=resultCLSID, clsctx=clsctx)

def GetActiveObject ( Class , clsctx = pythoncom . CLSCTX_ALL ) : resultCLSID = pywintypes . IID ( Class ) dispatch = pythoncom . GetActiveObject ( resultCLSID ) dispatch = dispatch . QueryInterface ( pythoncom . IID_IDispatch ) return __WrapDispatch ( dispatch , Class , resultCLSID = resultCLSID , clsctx = clsctx )
python friendly version of getobjects progid/clsid functionality .