com

Pywin32 COM not able to set attribute keyerror

Pywin32 COM not able to set attribute keyerror Question: I’m trying to automate something using its com interface. There are some problems which I can’t get my head around. app = DispatchEx(‘CANoe.Application’) configs = app.Configuration.TestConfigurations config = configs.Item(1) unit = config.TestUnits.Item(1) unit.Name unit.Enabled Until here it is fine, name and enabled will print out a …

Total answers: 1

VSCode debugger not releasing COM object reference when a Python script throws an exception

VSCode debugger not releasing COM object reference when a Python script throws an exception Question: I’ve observed a strange behavior where VSCode does not release COM object references while debugging. PyCharm works fine. To see this in action do the following: Start Excel (the problem occurs with other apps too, I’m using Excel for this …

Total answers: 1

Python win32com – Class not registered error

Python win32com – Class not registered error Question: I’m trying to control a device (Gamry Interface 5000 Potentiostat) via its COM interface using win32com. # Imports import win32com.client as client # Get device list devices = client.Dispatch(‘GamryCOM.GamryDeviceList’) # Iterate through devices for i in range(devices.Count()): # Get device (this wors as we only have one …

Total answers: 3

CANoe multiple instances using win32com

CANoe multiple instances using win32com Question: I’m trying to create two CANoe instances using Python (win32com module). I’m trying to create two objects and open the configurations, but it creates only one instance. How can I achieve creating two CANoe instances? I disabled the option in the application which was to permit only one instance …

Total answers: 2

com_error: (-2147221005, 'Invalid class string', None, None)

com_error: (-2147221005, 'Invalid class string', None, None) Question: I am trying to connect to Outlook with Python but the following line throws the com_error outlook = win32com.client.Dispatch(“Outlook.Application”).GetNamespace(“MAPI”) The complete Traceback is as follows: ————————————————————————— com_error Traceback (most recent call last) c:usersdipf5appdatalocalprogramspythonpython37libsite-packageswin32comclientdynamic.py in _GetGoodDispatch(IDispatch, clsctx) 88 try: —> 89 IDispatch = pythoncom.connect(IDispatch) 90 except pythoncom.ole_error: com_error: …

Total answers: 2

Deactivate Hot spots in CanOe using it's COM interface

Deactivate Hot spots in CanOe using it's COM interface Question: my issue is to deactivate a loggingblock in CanOE by using it’s COM interface. As programming langugage I’m using Python. I have Access to the LoggingCollection and can set the filename. Now I will deactivate this block, but I can’t find a way to do …

Total answers: 2

Unprotect an Excel file programmatically

Unprotect an Excel file programmatically Question: We’re getting an Excel file from a client that has open protection and Write Reserve protection turned on. I want to remove the protection so I can open the Excel file with the python xlrd module. I’ve installed the pywin32 package to access the Excel file through COM, and …

Total answers: 6

Use IDM(Internet Download Manager) API with python

Use IDM(Internet Download Manager) API with python Question: I am trying to use the IDM api through python but I’m completely lost on how i would do this. http://www.internetdownloadmanager.com/support/idm_api.html Could someone please help me? I don’t even know if it is possible to do this with python. Asked By: Ramis || Source Answers: The IDM …

Total answers: 2

How can I use Microsoft Word's spelling/grammar checker programmatically?

How can I use Microsoft Word's spelling/grammar checker programmatically? Question: I want to process a medium to large number of text snippets using a spelling/grammar checker to get a rough approximation and ranking of their “quality.” Speed is not really of concern either, so I think the easiest way is to write a script that …

Total answers: 2