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

Free Support Forum - aspose.com

Aspose.Cells does not throw an exception when opening Word document

Hello,

After updating our project to Aspose.Cells 5.1.1 one of our unittests fail. This specific test is expected to throw an exception when a Word document is passed to Aspose.Cells.

Please find attached the Word document.

The code opens the file in the ctor like so; var x = new Workbook(filename); but does not throw an exception. Inspecting the Worksheet collections reveals 0 sheets.

/Uffe

Hi,

Well, if the template file format is not native Excel format, Aspose.Cells would try to open it in Unknown format, e.g
new LoadOptions(LoadFormat.Unknown).

Anyways, do you still want to throw exception if non native format e.g .doc is given to Aspose.Cells for loading. We will get back to you soon.

Thank you.



Not sure if I understand.

If it is not expected behavior it should throw an exception (earlier versions threw exceptions).

If this is expected default behavior, can I configure Aspose.Cells to throw exceptions when eg. a Word document is supplied as a parameter?

Thanks,

/Uffe

Hi,

I think we should throw an exception when a doc file is given to Aspose.Cells for loading/opening. Will it suit your need. Anyways, we need to discuss this matter with our team. We will look into it and let you know about it soon.

Thank you.