Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pywinauto - Can't connect to office documents using the UIA backend

I'm having an unusual problem lately that when I open some excel/word document and try to connect to it's process using -

app = pywinauto.Application(backend="uia").connect(process=19812)

It seems not to work, meaning that app.is_process_running() returns False and the top_window() method raises the RuntimeError(No windows for that process could be found) exception.

But if I run the actual executable program (Winword.exe or Excel.exe and not some *.xls file), it seems to work properly and everything seems to work fine.

I checked the UIA compatibility with inspect.exe on the documents and everything seems to be fine.

What can be the problem here?

like image 757
Drxxd Avatar asked Dec 28 '17 15:12

Drxxd


1 Answers

Running the python script with admin privileges solved the problem :\

like image 79
Drxxd Avatar answered Oct 03 '22 20:10

Drxxd