comtypes
comtypes copied to clipboard
getting OSError: [WinError -2146959355] Server execution failed when opening word doc
When running on Windows 10 Pro 10.0.19541 N/A Build 19541 and using;
https://www.python.org/downloads/release/python-381/
When I do:
wdToPDF = CreateObject("Word.Application")
wdFormatPDF = 17
if os.path.exists(pdf_path):
os.remove(pdf_path)
pdfCreate = wdToPDF.Documents.Open(word_path)
I get:
File "C:\Users\mlwp\AppData\Local\Programs\Python\Python38-32\lib\site-packages\comtypes\client_init_.py", line 238, in CreateObject obj = comtypes.CoCreateInstance(clsid, clsctx=clsctx, interface=interface) File "C:\Users\mlwp\AppData\Local\Programs\Python\Python38-32\lib\site-packages\comtypes_init_.py", line 1225, in CoCreateInstance _ole32.CoCreateInstance(byref(clsid), punkouter, clsctx, byref(iid), byref(p)) File "_ctypes/callproc.c", line 948, in GetResult OSError: [WinError -2146959355] Server execution failed
@mwoodpatrick
Does this mean "The combination of comtypes and Word is currently not available, probably due to a Windows Update"?
Is your script still unworkable?