Winnovative – 用超链接parsingexcel文件失败(仅限xls)

使用Winnovative的excel库我可以parsing一个包含超链接的excel文件(xls)。 它可以在程序直接在我的机器上运行。 如果我尝试上传到网站并parsing它,则完全相同的文件将失败。 这是一个逻辑的例子:

// Works when bytes are parsed from a program running locally. // Fails when bytes are parsed from a file uploaded to a website public void TestRead(byte[] bytes) { try { // Parse excel file var workBook = new ExcelWorkbook(new MemoryStream(bytes)); // Save file var toSave = workBook.Save(); System.IO.File.WriteAllBytes(@"C:\Users\[User]\Downloads\Test.xls", toSave); } catch (Exception e) { } } 

这只是xls文件的一个问题。 我没有parsing一个超链接xlsx文件的麻烦。 上传的文件无法parsingexception(即使它被封装在一个try-catch块中也会导致应用程序崩溃):

无法打开工作簿。算术运算导致溢出。

Winnovative.ExcelLib.ExcelWorkbook..ctor(Stream excelStream,String openPassword,ExcelWorkbookDefaultSettings defaultSettings)在Winnovative.ExcelLib.ExcelWorkbook..ctor(Stream excelStream)

System.OverflowException未处理消息:wnvxls.dll中发生types为“System.OverflowException”的未处理exception其他信息:算术运算导致溢出。