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

New Post: Unable to add new sheet to existing workbook

$
0
0
I am using NPOI 2.1.3, and having an issue where the workbook.CreateSheet method is not adding a new sheet to an existing workbook. It's not even overwriting the sheet that's already there.

Here's my code:

FileStream fs = new FileStream(myExistingWorkbook.xlsx, FileMode.Open, FileAccess.ReadWrite);
IWorkBook workbook = new XSSFWorkbook(fs);
ISheet sheet1 = workbook.CreateSheet(newSheet);
sheet1.SetActive(true);

This code throws no errors, but still isn't working. Ideas? I'm using Excel 2013, FYI.

Viewing all articles
Browse latest Browse all 1621

Trending Articles



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