Bug 22454 - Throw exception when creating sheet with a duplicate name
Summary: Throw exception when creating sheet with a duplicate name
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-pre3
Hardware: Other Linux
: P3 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2003-08-15 11:49 UTC by Willem MOORS
Modified: 2005-08-25 20:34 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Willem MOORS 2003-08-15 11:49:51 UTC
MS-Excell can open/edit a POI/HSSF generated spreadsheet that contains sheets
with duplicate names, but on closing or saving the spreadsheet it crashes
everytime (version tested: Excel 2000, 9.0.3821 SR-1). 

Solution: avoid creating sheets with duplicate names by letting method
workBook.createSheet(sheetName) throw an exception when it creates a sheet with
a name that already exists.
Comment 1 Jason Height 2005-08-26 04:34:10 UTC
Done some time ago:

java.lang.IllegalArgumentException: The workbook already contains a sheet of
this name
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.createSheet(HSSFWorkbook.java:388)