We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save of XLSX file crashes with an InvalidCastException

A new problem with Aspose.Cells is the crash below while saving as an XLSX. A save of the identical file as an XLS works fine. As previously reported, in, the XLSX file is generated but the pivot table is corrupted.

Once again, the situation is too complex to provide a small reproducible example, but this might be a case where simple inspection of the source code reveals the problem.

System.InvalidCastException: Unable to cast object of type 'System.Int32[]' to type 'ጡ.☇'. ... at ڀ.䞩.䞯(XmlTextWriter ङ) ... at ڀ.䞩.घ(XmlTextWriter ङ) ... at ڀ.䜒.䜚(㐢 ⃇) ... at ڀ.䜒.䓢(㐢 ⃇) ... at ڀ.䜒.䋳() ... at ڀ.䜒.घ() ... at Aspose.Cells.Workbook.Save(Stream stream, SaveOptions saveOptions) ... at ModelSheet.AsposeGenerator.AsposeGenerator.GetStreamForXLS(Object exbook, String format) in C:\Devo\ModelSheet\Model\Spreadsheet\Aspose.cs:line 487 ... at RequestProc.Processor.CreateOutput(String basedir, String user, String modelname, ProgressStep root, WorkData wd) in C:\Devo\ModelSheet\RequestProc\Processor.cs:line 469 ... at RequestProc.Processor.<>c__DisplayClassa.b__3() in C:\Devo\ModelSheet\RequestProc\Processor.cs:line 288


Hi Howard,

Many thanks for the details. Please send us the Excel file you are using and the resultant file produced by executing the code using Aspose.Cells v5.1.3. This will help us to trace the issue.


The crash has gone away in but the corrupted XLSX file remains as dicussed on thread: