I'm trying to update an excel .xlsm with macros. Which library is best for this? I'm using at the moment Openpyxl, but it doesn't work properly. The following lines work, but the saved excel looses a bit of format (borders and I'm afraid it will loose macro functionality too).
from openpyxl import load_workbook
path = "my_path.xlsm"
# Load workbook
wb = load_workbook(path, keep_vba=True)
sheet_names = wb.sheetnames
# wb.get_sheet_names()
print(sheet_names)
# Select sheet
ws = wb["Sheet1"]
# Some Operations in excel
# Save the file
wb.save("my_path_new.xlsm")
Any other library recommendations?
Many thanks, Carmen