[BUG] csv write not work correct
- Dominant language
- JavaScript
- Stars
- 15.5k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
## 🐛 Bug Report
exceljs 4.4.0
## Steps To Reproduce
```javascript
const ExcelJS = require('exceljs');
const fs = require('fs');
const workbook = new ExcelJS.Workbook();
const worksheet = workbook.addWorksheet('My Sheet');
const rows = [
[1, 'John Doe', new Date(1970, 1, 1)],
[2, 'Jane Doe', new Date(1965, 1, 7)],
[3, 'Sam Smith', new Date(1980, 5, 15)]
];
worksheet.addRows(rows);
const fileOptions = { sheetName: 'My Sheet' };
// Ensure the worksheet name is correct and exists
if (workbook.getWorksheet('My Sheet')) {
await workbook.csv.writeFile('output.csv', fileOptions)
.then(() => {
console.log('CSV 文件写入成功。');
})
.catch(error => {
console.error('写入 CSV 文件时出错:', error);
});
} else {
console.error('工作表名称 "My Sheet" 不存在。');
}
cannot write to 'My Sheet', open csv jsut get a output sheet, how to resolve?
```
## The expected behaviour:
## Possible solution (optional, but very helpful):
```javascript
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.