I'm new in python, and I tried to write data into existing excel file using openpyxl, my excel file has a little complicated format. After running my simple code, I checked my excel file and all the format is corrupted.
This is my code:
import openpyxl
xfile = openpyxl.load_workbook('sample.xlsx')
sheet = xfile.get_sheet_by_name('Sheet1')
sheet['A1'] = 'hello world'
xfile.save('sample.xlsx')
Please help me figure out how to fix it, or suggest an alternative library that can work well with "xlsx" file.