Я использую python 2.74< Версия /strong> и openpyxl — 2.4.8
Код: Выделить всё
import openpyxl
from xlwt import easyxf
book = openpyxl.load_workbook('macroexcel.xlsm',keep_vba=True) #opens excel file
sheet = book.get_sheet_by_name('SheetName') #Get the sheet name
sheet['K34'] = 'Value' #Assign value to a cell connected to the macro
book.save('newexcel.xlsm') #Save
Спасибо.< /п>
Подробнее здесь: https://stackoverflow.com/questions/492 ... g-openpyxl
Мобильная версия