AlJohri / docx2pdf

MIT License
497 stars 94 forks source link

Convert Com_error #69

Closed enesertu closed 1 year ago

enesertu commented 1 year ago

I want to convert 2 docx files (which are in same path) in same code.

Yesterday it was working. But today i have an error. Still it's working, it convert files but it stop the code and i have different codes after it.

I didn't change anything.

Error is: 0%| | 0/4 [00:00<?, ?it/s] Traceback (most recent call last):

File "C:\Users\username\word_automation\example.py", line 372, in convert("C:/Users/username/word_automation/")

File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\docx2pdf__init__.py", line 106, in convert return windows(paths, keep_active)

File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\docx2pdf__init__.py", line 25, in windows doc = word.Documents.Open(str(docx_filepath))

File "<COMObject >", line 5, in Open

com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft Word', 'Dosya bozuk görünüyor.', 'wdmain11.chm', 25272, -2146822496), None)

How can i fix this?

Thanks for your help.

enesertu commented 1 year ago

I solved the error.

My program makes new word files from another word files. And one of the new word file left a hidden broken word file which name is $new.docx. And i can't see it even open hidden files.

I searched it and i saw, i should write to cmd attrib -h -r -s /s /d C:\*.*for be appear hidden files. And in programs folder, it appeared.

I deleted it, error fixed.