Handling VBA macros prompts in python

106 views Asked by At

How to handle prompts generated when running the macros using the below code?

import win32com.client
import time

xl=win32com.client.Dispatch('Excel.Application')
xl.Visible = 1
xl.DisplayAlerts = False
xl.Workbooks.Open(Filename=r'FilaName.xlsm')
xl.Application.Run('r'FilaName.xlsm!MacrosName.MacrosName')
xl.Application.Quit()
del xl

The process opens a prompt and waits for manual input. How do we automate this thing?

I have few ideas like using the Threads, but it seems to be a long shot. Any simpler ideas?

0

There are 0 answers