问题
So far I've seen examples of invoking an Excel Application using pywinauto. Can I open an existing Excel Workbook using pywinauto ?
回答1:
You Don't even need pywinauto for this. Just open excel with subprocess and use command line switches to open your doc
But if you insist on using pywinauto
Then Try
.MenuSelect("File -> Open")
Then
.Edit.TypeKeys("*Filename with absolutepath*", with_spaces = True)
Then
.No.Click()
Or something to that effect if those are not the actual elements names
来源:https://stackoverflow.com/questions/18843602/open-an-existing-excel-workbook-using-pywinauto