How to run a macro that is associated with a button within an Excel form? Python - Xlwings

36 views Asked by At

I need to execute the macro that is associated with the 'Insertar Fila Debajo' button that is within the 'FrmBuscarTxt_Frm' form with python xlwings. Help!!

enter image description here

macro1 = app.macro('FrmBuscarTxt_Frm.Add_linea_Dw_Click') macro1()

macro2 = app.macro('Add_linea_Dw_Click') macro2()

Try the above ways and many more, but always the result is: com_error: (-2147352567, 'An exception occurred.', (0, 'Microsoft Excel', 'The macro "Add_linea_Dw" cannot be executed. macro is not available in this workbook or all macros have been disabled.', 'xlmain11.chm', 0, -2146827284), None)

0

There are 0 answers