Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming/deleting main sheet causes corrupt excel file #367

Open
kkellogg378 opened this issue Aug 20, 2024 · 0 comments
Open

Renaming/deleting main sheet causes corrupt excel file #367

kkellogg378 opened this issue Aug 20, 2024 · 0 comments

Comments

@kkellogg378
Copy link

kkellogg378 commented Aug 20, 2024

Doing any of the following:

excel = Excel.createExcel();
excel.rename(excel.sheets.keys.first, sheetName);
excel = Excel.createExcel();
excel.rename("Sheet1", sheetName);
excel = Excel.createExcel();
excel[sheetName];
excel.setDefaultSheet(sheetName);
excel.delete('Sheet1');

followed by

Sheet sheetObject = excel[sheetName];
sheetObject.setDefaultColumnWidth(30.0);
sheetObject.setDefaultRowHeight(15.0);

var fileBytes = excel.save();
File(path)
  ..createSync(recursive: true)
  ..writeAsBytesSync(fileBytes!);

results in a corrupt excel file on excel 4.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant