Can't open xlsx file with bad reference on another sheet

Hi,

I've got an xlsx file with a formula that refere a cell on another sheet like this :

=Feuil2!B1

But the Cell B1 doesn't exist, so there is a bad reference : =Feuil2!#REF!

There is no problem with an invalid reference on the same sheet.

I can't open this file. The stack trace is :

Aspose.Cells.CellsException: Error in Cell: J21-Invalid formula:"='RH-IN'!#REF!*80%".
à Aspose.Cells.x40937ad35b1cf5f7.x1f490eac106aee12(Cell xe6de5e5fa2d44af5, String xef81f2df12e64618, Byte x804d9de34bfbea97)
à Aspose.Cells.OpenXML.x7661ca2b53df3da9.xb953ef709de3d2ab(XmlTextReader xb9763b0038341e6c, Int32 x3e0a106e44f5f6eb, Int32 x5b0d56b787e972e9)
à Aspose.Cells.OpenXML.x7661ca2b53df3da9.xd9c6f1ce6ced5eb4(XmlTextReader xb9763b0038341e6c)
à Aspose.Cells.OpenXML.x7661ca2b53df3da9.x5b9fbbb55c31a1b7(XmlTextReader xb9763b0038341e6c)
à Aspose.Cells.OpenXML.x7661ca2b53df3da9.x06b0e25aa6ad68a9(XmlTextReader xb9763b0038341e6c)
à Aspose.Cells.OpenXML.x9d49ab444acbddce.x72bde2882aefe5af(x1f5f0dd7560ed867 xd9171314ec0b2957, String x7d11dcd405070662)
à Aspose.Cells.OpenXML.x9d49ab444acbddce.xc3266f78bb6c4216(x1f5f0dd7560ed867 xd9171314ec0b2957, String x7d11dcd405070662)
à Aspose.Cells.OpenXML.x9d49ab444acbddce.x88ae89d546ee9fdf()
à Aspose.Cells.Workbook.Open(Stream stream, FileFormatType type)
à Aspose.Cells.Workbook.Open(String fileName)
à xlsx2Db.FileProcess.openFile()

Thanks for your help.

Best regards

Hi,

Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells. We tested your issue with this version and it works fine. Please check it and let us know if it works fine for you too. If you still face any problem, please share your template file with us and we will check it soon.

Thank You & Best Regards,

hi,

I try with the last version 4.7.1 and it's not working. It seems to be related to the name of the sheet.

You will find in attachment my Excel File

and the code

mWorkbook = new Workbook();

try

{

log.Debug("Opening the file...");

//Do not recalculate the values of the cells

mWorkbook.ReCalcOnOpen = false;

//Calling Open method of Workbook object to open an Excel file using its file path

mWorkbook.Open(mFilePath, FileFormatType. Excel2007Xlsx);

}

catch (Exception ex1)

{

log.Error("Could not open the file. ",ex1);

//return;

Thanks for your Help

Best Regards,

Hi,

I have tested using your code with your file, it works fine with the attached version. Please try the attached version/fix, if you still find the issue, kindly post your template (input) excel file here, we will check it soon.

Thank you.

Hi,

it works fine with the attached version!

Thanks a lot

Best regards

Hi;

I've got another error with formula. if the cell contain a formula like =+-D11 the workbook does'nt open.

you file find a sample in attachment.

Thanks,

Best regards,

Hi,

Thank you for sharing the template file.

We have found your mentioned issue after an initial test. We will look into it and get back to you soon.

Thank You & Best Regards,

Hi,

Thank you for considering Aspose.

Please download and try our latest official release for Aspose.Cells for .NET: http://www.aspose.com/community/files/51/file-format-components/aspose.cells-for-.net-and-java/entry195573.aspx

We have fixed your mentioned issue in the latest release. Please try it and let us know if you still find the issue.

Note: Just for your knowledge, in the new release v4.8.0, we have merged Aspose.Grid suite to Aspose.Cells for .NET msi installer as Aspose.Grid would be no longer offered as a separate product now. You need to install the installer (uninstall older one first if you have) and use only Aspose.Cells.dll library in your project for your need. You may also take advantage using Aspose.Cells Grid suite though.

Thank You & Best Regards,


Hi,

It works with the last version of aspose.cell

Thanks

Best regards