from ironxl import * # Load existing spreadsheet workbook = WorkBook.Load("sample.xlsx") worksheet = workbook.DefaultWorkSheet # Apply auto resize on row 2 worksheet.AutoSizeRow(1) # Apply auto resize on column A worksheet.AutoSizeColumn(0) # Apply auto resize on column D worksheet.AutoSizeColumn(3, True) # Save changes with the applied auto-resize workbook.SaveAs("autoResize.xlsx")