I have a excel file which consists of data. I need to Add few rows at the beginning of the excel file without overwriting the already present rows at beginning.
The code i am trying shown below works fine in adding the rows to excel but its replacing the contents at the initial rows or overwriting on top of it.
workbook = xlsxwriter.Workbook('Demo.xlsx')
worksheet = workbook.add_worksheet()
worksheet.set_column('A:F', 20)
worksheet.set_row(1, 30)
worksheet.set_row(2, 50)
worksheet.set_row(3, 50)
merge_format = workbook.add_format({
'bold': 1,
'border': 5,
'font_size':15,
'align': 'center',
'valign': 'vcenter',
'fg_color': 'white'})
worksheet.merge_range('A1:F1', 'Production Description, Amazon', merge_format)
# Merge 3 cells over two rows.
worksheet.merge_range('A2:F2', 'Sample Name', merge_format)
worksheet.merge_range('A3:F3', 'Progress Reports : Internal Assessment 1', merge_format)