Repository navigation
Description
What happened
Issue: Excel File Generated in Flutter Web Cannot Be Opened in Microsoft Excel
I am generating an Excel (.xlsx) file in my Flutter application using the excel_plus package.
The file is generated and downloaded successfully on the web platform. However, Microsoft Excel reports an error when I try to open it.
Interestingly, the same Excel generation logic works correctly in the mobile application. Files generated on mobile open without any issues.
Expected behavior: Excel files generated by the Flutter web application should open successfully in Microsoft Excel, just like files generated by the mobile application.
Actual behavior: Files generated on Flutter Web are downloaded successfully but cannot be opened in Microsoft Excel.
Environment:
- Framework: Flutter
- Platform: Flutter Web
- Excel package:
excel_plus2.27.1 - File download package:
file_saver - File format:
.xlsx
I am attaching 2 excels one generated from web and another from mobile.
test-web.xlsx - Generated from web -> Not working
test-mobile.xlsx - Generated from mobile -> Working fine
What were you doing
Creating a file from scratch
Where did the file come from
Not applicable
excel_plus version
2.27.1
Dart or Flutter version
Flutter: 3.47.4
Where it runs
Web (dart2js)
Code that reproduces it
import 'dart:typed_data';
import 'package:excel_plus/excel_plus.dart';
Future<Uint8List> generateTestXlsx() async {
final excel = Excel.createExcel();
final sheet = excel['Sheet1'];
sheet.updateCell(
CellIndex.indexByString('A1'),
TextCellValue('Hello Excel'),
);
final bytes = excel.encode();
if (bytes == null) {
throw StateError('XLSX encoding failed.');
}
return Uint8List.fromList(bytes);
}
// Generates excel bytes
final bytes = generateTestXlsx();
// Save file
await FileSaver.instance.saveFile(
name: 'test',
bytes: bytes,
fileExtension: 'xlsx',
mimeType: MimeType.microsoftExcel,
);Error and stack trace
The file, if you can share it
No response
Before submitting
- I reproduced this on the latest published version.
- The file opens correctly in the application that wrote it.
Activity
ParthBaraiya commentedon Oct 11, 2026
Update:
The issue has been identified in the
archivepackage. I've submitted a fix in [PR #420](brendan-duncan/archive#420).Once the PR is merged and a new package version is released, updating the
archivedependency version inpubspec.yamlshould resolve this issue.ParthBaraiya commentedon Oct 11, 2026
New version of archive package is released with the fix. So, running
dart pub upgradeshould fix the issue.I've raised the #5 to update the min version of
archivepackage to avoid any unexpected failures.almasumdev commentedon Oct 16, 2026
Thanks @ParthBaraiya, and not just for the report. You traced this past excel_plus into
archive, worked out that it was corrupting entries on web, and then went and fixed it upstream rather than asking us to work around it. That is a lot more work than filing a bug, and it fixed the problem for everyone usingarchive, not only for us here.Your PR #5 is merged and shipped in 2.27.2, so the minimum is now
^4.5.1and a resolve can no longer land on a version with the bug. You are on the contributor list for the repo too.If excel_plus is useful to you, a star would be genuinely appreciated. It is the main way the package gets found by people with the same problem you had.