Python Forum

Full Version: Append excel sheet using openpyxl
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The code below does not append
Can anyone help please

from openpyxl import load_workbook
workbook_name = '/home/pi/Desktop/Data/Test.xlsx'
wb = load_workbook(workbook_name)
page =
import openpyxl as op
Col1 = 'Apples'
Col2 = 'Pears'
wb = op.load_workbook(workbook_name)
ws = wb[wb.sheetnames[0]]
ws.append([Col1, Col2])
What does that code do?
Are there any errors? What are they?