0

I'm trying to get this program running.

I uses Python 3.7.2 in Win10 Enterprise (Version 10.0.17763 Build 17763) and the system is based on 64 bit.

I tried to make it work on several PCs. On some of them, it worked.

import win32com.client
o = win32com.client.Dispatch("Object.Name")
o.Method()
o.property = "New Value"
print(o.property)
o.prop_map_get_.keys()

o = win32com.gencache.EnsureDispatch('Excel.Application')
o.Visible = 1
o.Workbooks.Add()
o.Cells(1, 1).Value = "Hello"

Error :

Traceback (most recent call last):
  File "test.py", line 2, in <module>
    o = win32com.client.Dispatch("Object.Name")
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221005, 'Ungültige Klassenzeichenfolge', None, None)

1 Answer 1

2

You have to disable all the secure-boot-options in the BIOS. I had this problem, too.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.