I am pretty sure there is an easier way than how i am doing it, I just have two workbooks and a single sheet in each work book,
does anyone have any any suggestions?
import openpyxl as xl
path1 = 'C:\\Users\\path\\test1.xlsx' path2 ='C:\\Users\\path\\test2.xlsx'
wb1 = xl.load_workbook(filename=path1) ws1 = wb1.worksheets[0]
wb2 = xl.load_workbook(filename=path2) ws2 =
wb2.create_sheet(ws1.title)
for row in ws1:
for cell in row:
ws2[cell.coordinate].value = cell.value
wb2.save(path2)
The above code works for me, however it does not copy the format. just the cell values. I need formatting of the reports to be the same.