Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Created Unassigned: Writing to Xlsx file having hash sign (#) in sheet name causes the file to be corrupt [12751]

$
0
0
Opening a existing XSLX file that have a sheet with hash sign and then saving it, causes the file to be corrupt.

```
var fileInfo = new FileInfo("SheetNameContainsHashSign.xlsx");
IWorkbook workbook;

using (var fileStream = fileInfo.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
workbook = WorkbookFactory.Create(fileStream);
}

using (var stream = fileInfo.OpenWrite())
{
workbook.Write(stream);
}
```

Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>