Help with COM_error

J

John Lay

I am not a programmer, but this past week I have had a crash course in
python scripting am have been rather impressed with myself for having
written a fairly complicated script that among many other processes
reads a database table via SearchCursor, populates a word template via
Bookmarks, then saves the document out as a PDF.

The only problem is that it only works on my computer. When I move the
script to another computer with the same setup, I continue to receive
a Com_error.

The script fails at my SaveAs(out_TOC, FileFormat=wdFormatPDF)
statement. I have tried both win32com.client and comtypes.client and
receive a similar error for both.

win32.client:
com_error: (-2147352567, 'Exception occurred.', (0, u'Microsoft Word',
u'Command failed', u'C:\\Program Files\\Microsoft Office\\Office12\
\1033\\WDMAIN11.CHM', 36966, ), None)

comtypes.client:
COMError: (-2146824090, None, (u'Command failed', u'Microsoft Word',
u'C:\\Program Files\\Microsoft Office\\Office12\\1033\\WDMAIN11.CHM',
36966, None))

It has been suggested that I try python-docx, but I have not been able
to get the module to work for me and I have been unable to find any
documentation on it.

Can anyone help with the com errors? What do they mean? How do I
resolve them?

Any help would be appreciated.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top