Running Libreoffice BASIC macro from python
问题 I've a macro in LibreOffice BASIC and I want to run it from my python program. I've found some threads in which they use this code: import os import win32com.client if os.path.exists("excelsheet.xlsm"): xl=win32com.client.Dispatch("Excel.Application") xl.Workbooks.Open(Filename="C:\Full Location\To\excelsheet.xlsm", ReadOnly=1) xl.Application.Run("excelsheet.xlsm!modulename.macroname") ## xl.Application.Save() # if you want to save then uncomment this line and change delete the ", ReadOnly=1"