I'm using Python to open quite complicated Excel file. I have managed how to open spreadsheet, fill data and run macro. The problem is, that this macro in the end is returning message about result as message box which requires user to click OK button, and will not continue untill button will be pressed. I need to do this process fully automatical, so I need to click 'OK' from Python. How can I do this? Would be great if I could read message from messagebox, but it is not necessary.
Here is my code:
import win32com.client
xl=win32com.client.Dispatch("Excel.Application")
xl.Workbooks.Open(Filename="my_excel.xlsm")
xl.Application.Run("'my_excel.xlsm'!my_macro")
# here I need to click OK, but my code will never reach this place until I'll click it manually
xl.Application.Quit()