import pandas as pd from openpyxl import load_workbook # Load the Excel file and sheet book = load_workbook('example.xlsx') writer = pd.ExcelWriter('example.xlsx', engine='openpyxl') writer.book = book writer.sheets = {ws.title: ws for ws in book.worksheets} existing_data = pd.read_excel(writer, 'Sheet1') # Append new data to the existing data new_data = pd.DataFrame({'col1': [1, 2, 3], 'col2': [4, 5, 6]}) all_data = pd.concat([existing_data, new_data]) all_data.to_excel(writer, index=False, header=True, sheet_name='Sheet1') # Save the changes writer.save()
Help, I have the following code: List_of_values = BarcodeData wb = xw.book ('Records.xlsm') ws = wb.sheets ['INCOME'] ws.range ('A3) .value = list_of_values wb.save () I am reading the data from a QR code reader, so when it is read it sends me the data to an excel sheet, but in the part ('A3') I am indicating that in that cell I put the value read. What I want to do is that every time a code is read, I enter it in different cells, that is; The first read in A3, the second read in A4, the third read in A5 and so on, how can I change that line? I already tried with (A3: A10) and from A3 to A10 it gives me the same value.
one of the best edited and step by step tutorial i have ever seen!
I don't usually leave comments but that was an excellent introduction covering the main essentials, thanks
Nice Work!
Great thanks. A very very good tuto
Xlwings should be taught at school ! Nice video Hamid
Great video thank you !
Great video! Really appreciate this!!
Thank You. Is the file TSLA avaiable?
Is the Jupyter Notebook available somewhere?
Hello, how to use xlwings server in wsl system step by step instraction
Thanks for the video Hamid! Is there a publicly available version of the Jupyter notebook you are using in this video?
@@hamidboustanifar6494 thanks so much
how do I delete a row ?
import pandas as pd
from openpyxl import load_workbook
# Load the Excel file and sheet
book = load_workbook('example.xlsx')
writer = pd.ExcelWriter('example.xlsx', engine='openpyxl')
writer.book = book
writer.sheets = {ws.title: ws for ws in book.worksheets}
existing_data = pd.read_excel(writer, 'Sheet1')
# Append new data to the existing data
new_data = pd.DataFrame({'col1': [1, 2, 3], 'col2': [4, 5, 6]})
all_data = pd.concat([existing_data, new_data])
all_data.to_excel(writer, index=False, header=True, sheet_name='Sheet1')
# Save the changes
writer.save()
Help, I have the following code: List_of_values = BarcodeData
wb = xw.book ('Records.xlsm')
ws = wb.sheets ['INCOME']
ws.range ('A3) .value = list_of_values
wb.save ()
I am reading the data from a QR code reader, so when it is read it sends me the data to an excel sheet, but in the part ('A3') I am indicating that in that cell I put the value read. What I want to do is that every time a code is read, I enter it in different cells, that is; The first read in A3, the second read in A4, the third read in A5 and so on, how can I change that line? I already tried with (A3: A10) and from A3 to A10 it gives me the same value.
have you found the solution to this? i am facing similar issue, if you have found solution please help. TIA
To be honest, not too sure what's point of using this Xlwings, like what exactly that Xlwings can do better than VBA?