Based on the limited documentation I can found I have written the following code:
import win32com.client
import xml.etree.ElementTree as Et
newSession = win32com.client.Dispatch("QBXMLRP2Lib.RequestProcessor2")
but I am getting the following error:
>Traceback (most recent call last):
> File "C:\Users\Clear\AppData\Local\Programs\Python\Python37\lib\site->packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch
> IDispatch = pythoncom.connect(IDispatch)
>pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)
>
>During handling of the above exception, another exception occurred:
>
>Traceback (most recent call last):
> File >"C:\Users\Clear\AppData\Local\Programs\Python\Python37\learn_win32com.py", >line 4, in <module>
> newSession = win32com.client.Dispatch("QBXMLRP2Lib.RequestProcessor2")
> File "C:\Users\Clear\AppData\Local\Programs\Python\Python37\lib\site->packages\win32com\client\__init__.py", line 95, in Dispatch
> dispatch, userName = >dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
> File "C:\Users\Clear\AppData\Local\Programs\Python\Python37\lib\site->packages\win32com\client\dynamic.py", line 114, in >_GetGoodDispatchAndUserName
> return (_GetGoodDispatch(IDispatch, clsctx), userName)
> File "C:\Users\Clear\AppData\Local\Programs\Python\Python37\lib\site->packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
> IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, >pythoncom.IID_IDispatch)
>pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)
I am new to COM and win32com and still in the beginning stages of programming.
Can you help me understand what I am doing wrong?