bug with opening a xls template

Apr 20, 2011 at 11:06 AM
Edited Apr 20, 2011 at 11:56 AM

hi all:

    while I'm using NPOI to edit a excel file with a existing xls template. And I recieve a IOException, "block [ 119 ] already removed". Something like that. But it not happen everytime. Sometimes I open some other templates, it works very well. And my template filetype is 07-2003.  Here is the error message:

Unhandled Exceptions:  System.IO.IOException: block[ 119 ] already removed
   at NPOI.POIFS.Storage.BlockListImpl.Remove(Int32 index)
   at NPOI.POIFS.Storage.BlockAllocationTableReader.FetchBlocks(Int32 startBlock, Int32 headerPropertiesStartBlock, BlockList blockList)
   at NPOI.POIFS.Storage.BlockListImpl.FetchBlocks(Int32 startBlock, Int32 headerPropertiesStartBlock)
   at NPOI.POIFS.FileSystem.POIFSFileSystem.ProcessProperties(BlockList small_blocks, BlockList big_blocks, IEnumerator properties, DirectoryNode dir, Int32 headerPropertiesStartAt)
   at NPOI.POIFS.FileSystem.POIFSFileSystem..ctor(Stream stream)
   at NPOI.HSSF.UserModel.HSSFWorkbook..ctor(Stream s, Boolean preserveNodes)
   at NPOI.HSSF.UserModel.HSSFWorkbook..ctor(Stream s)
   a DemoExcel.Program.Main(String[] args) location: C:\Users\Lei\Desktop\DemoExcel\DemoExcel\Program.cs:line number 15

I'm sorry i don't know how to update the attachment. So if anyone wants to help me. Please leave your email address. Or send me a email to get the template.

My email: gldamao at gmail.com

thank you.


I think it's about the content in the template. I get a copy of the template and change some cell value. Run my application again, and it works fine.

Apr 21, 2011 at 1:55 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.