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 :
Kind regards,
Guillaume
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