from win32com.client import Dispatch
def runmacros():
mc_n= 'Test Macro.xlsm!Test_macro.Prueba'
fl_run= r'C:\Test\Test Macro.xlsm'
run_macro(mc_n, fl_run)
return render_template('main.jade')
def run_macro(macroname, filetorun):
pythoncom.CoInitialize ()
xlApp = Dispatch('Excel.Application')
xlWb = xlApp.Workbooks.Open(filetorun)
xlSht = xlWb.WorkSheets(1)
xlApp.visible = True
xlApp.Application.Run(macroname)
xlWb.Saved = 0
xlWb.Save()
xlWb.Close(SaveChanges=True)
xlApp.application.Quit()--
You received this message because you are subscribed to the Google Groups "python-excel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-excel...@googlegroups.com.
To post to this group, send email to python...@googlegroups.com.
Visit this group at http://groups.google.com/group/python-excel.
For more options, visit https://groups.google.com/d/optout.