Bug 46711

Summary: java.lang.RuntimeException when trying to read a sheet having protected cells
Product: POI Reporter: Vinu Kumar <vinu.kumar>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: regression    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows Server 2003   
Attachments: Repro file for the issue
Original file created in old version of Office
File which was edited and saved in Office 2007 with compatibility mode

Description Vinu Kumar 2009-02-12 20:08:50 UTC
Created attachment 23254 [details]
Repro file for the issue

Trying to read a xls with protected cells give the following exception:

java.lang.RuntimeException: two Page Settings Blocks found in the same sheet
        at org.apache.poi.hssf.model.Sheet.<init>(Sheet.java:228)
        at org.apache.poi.hssf.model.Sheet.createSheet(Sheet.java:160)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:287)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:201)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:317)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:298)
        at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:59)

Tested with the latest trunk
Comment 1 Vinu Kumar 2009-02-18 09:45:54 UTC
The sheet had some views specific to some users.
Comment 2 Tomas Prochazka 2009-03-11 00:23:19 UTC
I have .XLS file which I can normally open by POI library. I open it in Office 2007, edit same values in table and save it. And now I get the same exception from POI. I really think, that this is big problem. .XLS files which was edited in Office 2007 can't be open be POI library.

It's really invalid bug report? It's bug in Office 2007?
Comment 3 Tomas Prochazka 2009-03-11 00:27:30 UTC
Created attachment 23368 [details]
Original file created in old version of Office
Comment 4 Tomas Prochazka 2009-03-11 00:28:14 UTC
Created attachment 23369 [details]
File which was edited and saved in Office 2007 with compatibility mode
Comment 5 David Fisher 2009-03-11 23:29:01 UTC
Tomas,

The person that submitted this bug - Vinu - was the one who resolved it as invalid. I think that he had information in the file which should not be shared.

Rather than re-opening another issue, you really should submit a new bug. For instance you say your file was edited in Office 2007 and saved in compatibility mode. I wonder if you have applied every update to your copy of Office 2007? How did you edit the file?

Do you get exactly the same error.

Regards,
Dave
Comment 6 Tomas Prochazka 2009-03-12 00:06:09 UTC
(In reply to comment #5)
Ok. I entered new issue #46840