Using openpyxl , I try to read data from an Excel-Workbook and write data to the same Excel-Workbook. Getting data from an Excel-Workbook works fine, but writing data to an Excel-Workbook does not work. Using the code below, I get the value from cell A1 to Sheet1 and print it. Then I try to put some values ββin cells A2 and A3 . This does not work.
from openpyxl import Workbook from openpyxl import load_workbook wb = load_workbook("testexcel.xlsm") ws1 = wb.get_sheet_by_name("Sheet1")
I am sure the code is correct ... What is wrong here?
source share