nissl-lab / npoi

a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.
Apache License 2.0
5.74k stars 1.44k forks source link

NPOI.HPSF.ReadingNotSupported w/ NPOI 2.4.1, .xls, .net 4.7.2 #179

Closed purefunkce closed 3 years ago

purefunkce commented 5 years ago

I am getting an error when trying to open a file ([https://www.dropbox.com/s/lzig35pofzq5k86/example.xls?dl=0]). The file worked before I updated to .net framework 4.7.2 from 4.6, same NPOI framework. I am getting an exception on reading documentSummaryInformation or writing a workbook to file:

NPOIFSFileSystem fs = new NPOIFSFileSystem(new System.IO.FileInfo(PlateTemplateFilePath), true); HSSFWorkbook wb = new HSSFWorkbook(fs.Root, true); var x = wb.DocumentSummaryInformation; // Throws exception FileStream outstream = new FileStream(OutputXlsFilePath, FileMode.Create, FileAccess.Write, FileShare.None); wb.Write(outstream); //throws exception

NPOI.HPSF.ReadingNotSupportedException HResult=0x80131500 Message=HPSF does not yet support the variant type 4126 (unknown variant type, 000000000000101E). If you want support for this variant type in one of the next POI releases please submit a request for enhancement (RFE) To http://issues.apache.org/bugzilla/! Thank you! Source=NPOI StackTrace: at NPOI.HPSF.VariantSupport.Read(Byte[] src, Int32 offset, Int32 length, Int64 type, Int32 codepage)

tonyqus commented 5 years ago

HPSF hasn't been changed for years as I remember. There may be some other reasons