Quantcast
Channel: npoi Discussions Rss Feed
Viewing all articles
Browse latest Browse all 637

New Post: Bug when deleting then creating a worksheet

$
0
0
Hello,

I have a workbook with 3 worksheets ("Sheet1", "Sheet2", "Sheet3")
If i remove the last one ("Sheet3") and then create a new one nammed "Sheet4", i have the following exception :

An exception of type 'NPOI.OpenXml4Net.Exceptions.PartAlreadyExistsException' occurred in NPOI.OOXML.dll but was not handled in user code

Additional information: A part with the name '/xl/worksheets/sheet3.xml' already exists : Packages shall not contain equivalent part names and package implementers shall neither create nor recognize packages with equivalent part names. [M1.12]


My code :
ISheet s = _workBook.GetSheet("Sheet3");
if (s != null)
{
_workBook.Remove(s);
}
_workBook.CreateSheet("Sheet4");
Am i doing something wrong ?

Kind regards,
Guillaume

Viewing all articles
Browse latest Browse all 637

Trending Articles



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