Python Forum
Append excel sheet using openpyxl
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Append excel sheet using openpyxl
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?

Possibly Related Threads…
Thread Author Replies Views Last Post
  Add a new column when I extract each sheet in an Excel workbook as a new csv file shantanu97 0 179 Mar-24-2021, 04:56 AM
Last Post: shantanu97
  How to append a value to specific excel cell using openpyxl hobbyist 0 316 Mar-05-2021, 07:14 PM
Last Post: hobbyist
  How to Copy Single Value From One Excel Sheet to Another SunWers 4 460 Dec-29-2020, 05:39 PM
Last Post: SunWers
  Openpyxl tkinter search a value in Excel column Heathcliff_1 0 454 Dec-02-2020, 04:35 PM
Last Post: Heathcliff_1
  Writing to existing excel sheet jksvend 0 342 Oct-12-2020, 11:19 AM
Last Post: jksvend
  Openpyxl: Excel formula & condition formatting removed JaneTan 0 458 Sep-25-2020, 07:02 AM
Last Post: JaneTan
  Create new Excel instead of update certain sheet Pietertl 1 515 Sep-17-2020, 07:04 AM
Last Post: Pietertl
  Edit Open and Active Excel sheet in Python JoeDainton123 1 528 Jul-29-2020, 12:52 AM
Last Post: Larz60+
  copy content of text file with three delimiter into excel sheet vinaykumar 0 432 Jul-12-2020, 01:27 PM
Last Post: vinaykumar
  openpyxl - How can I copy some row from an excel file and paste them in another one? aquerci 2 3,093 Jun-07-2020, 04:26 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020