When trying to read XLS files that were saved with OpenOffice (reported on version 3.2) the exception below is raised. Sorry for the german text messages, but the content should be clear anyway.
System.ArgumentOutOfRangeException: Der Index lag außerhalb des Bereichs. Er muss nicht negativ und kleiner als die Auflistung sein.
Parametername: index
bei System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
bei System.Collections.Generic.SortedList`2.GetByIndex(Int32 index)
bei System.Collections.Generic.SortedList`2.ValueList.get_Item(Int32 index)
bei Net.SourceForge.Koogra.Excel.Worksheet..ctor(Workbook wb, BoundSheetRecord sheet, SortedList`2 records) in d:\src\3rdParty\Koogra\Excel\Worksheet.cs:Zeile 40.
bei Net.SourceForge.Koogra.Excel.Workbook.Load(CompoundFile doc) in d:\src\3rdParty\Koogra\Excel\Workbook.cs:Zeile 89.
bei Net.SourceForge.Koogra.Excel.Workbook..ctor(Stream stream) in d:\src\3rdParty\Koogra\Excel\Workbook.cs:Zeile 115.
bei Net.SourceForge.Koogra.WorkbookFactory.GetExcelBIFFReader(Stream stream) in d:\src\3rdParty\Koogra\WorkbookFactory.cs:Zeile 30.
...
I traced this to the following code segment (codebase: SVN tag of version 3.1.5) of the Worksheet.cs file, lines 37 following:
...
Biff seeker = records.Values[idx++];
while (!(seeker is IndexRecord))
seeker = records.Values[idx++];
IndexRecord index = (IndexRecord)seeker;
...
The while-loop never reaches an IndexRecord entry because it is missing for files created with OpenOffice.
I'm not sure if this is a real bug, as it might also be considered as a bug within OpenOffice, but as MS Excel 2003 opens the file just fine I decided to post it here.
To make it easier to reproduce the problem I attached a ZIP file containing two XLS files, one saved with MS Excel 2003 SP3, the other saved with OpenOffice 3.2.
ZIP with two XLS files, one saved with MS Excel 2003 SP3, the other saved with OpenOffice 3.2