.NET Core 6.0 COM interoperability issues with Python/Octave
See the question and my original answer on StackOverflowThe .NET Core wrapper doesn't support this type of call where you ask for IDispatch at the same time you create the COM object:
C / C++:
IDispatch* disp;
CoCreateInstance(YourCLSID, NULL, CLSCTX_ALL, IID_IDispatch, &disp); // fails
Python:
disp = pythoncom.CoCreateInstance(YourCLSID, None, pythoncom.CLSCTX_ALL, pythoncom.IID_IDispatch) // fails
You must first get an IUnknown reference and QI for IDispatch on it, like this in python (which is what Excel/VBA does):
import pythoncom
import pywintypes
from win32com.client import Dispatch
unk = pythoncom.CoCreateInstance(pywintypes.IID('{64D6F9F6-6163-401A-82E6-C941CAF01399}'), None, pythoncom.CLSCTX_ALL, pythoncom.IID_IUnknown)
disp = Dispatch(unk.QueryInterface(pythoncom.IID_IDispatch))
print disp.SayHello
IMHO, python COM support should be modified to do this always...