Bug with LoadOptions.Auto thinking an excel 97 doc is a word doc

Please find attached a sample application that demonstrates the LoadOptions.Auto failing for Excel97 documents where they are considered word documents. This breaks previous functionality.


As an intermediate hack I now have to test the file extension and set the load option to the right type before opening the file instead of just opening it as before.

To run the application, simply add a reference to Cells 7.2.1 and then run it.

A screenshot has been included so that you can see the error it produces “This is a word doc file.” - which is obviously wrong!

Please can you give a rough eta of when this will be looked at?

Thanks
Jon

Hi,


Thank you for using Aspose.Cells. I can observe the issue even with the latest fix of Aspose.Cells. We will forward this issue to our development team to look into it and assist further.

Cool - thanks…


My current hack if anyone needs it in the interim is…

          LoadOptions opts = new LoadOptions(LoadFormat.Auto);
        <span style="color:blue;">if</span> (filename.ToLower().EndsWith(<span style="color:#a31515;">"xls"</span>))
            opts = <span style="color:blue;">new</span> <span style="color:#2b91af;">LoadOptions</span>(<span style="color:#2b91af;">LoadFormat</span>.Excel97To2003);

Hi,


Thanks for sharing your workaround with other forum members.

Can you please tell us how was your X2050_V001.xls file generated? I have tried some other xls files with LoadFormat.Auto and couldn’t reproduce the issue with these files. We appreciate your comments in this regard and these will help us to further investigate the issue.

I have forwarded the issue to our development team for further investigation. We will let you know as we receive any update about it from our development team. The issue is logged as: CELLSNET-40731.
jbaggaley:
Cool - thanks...

My current hack if anyone needs it in the interim is...

          LoadOptions opts = new LoadOptions(LoadFormat.Auto);
        <span style="color:blue;">if</span> (filename.ToLower().EndsWith(<span style="color:#a31515;">"xls"</span>))
            opts = <span style="color:blue;">new</span> <span style="color:#2b91af;">LoadOptions</span>(<span style="color:#2b91af;">LoadFormat</span>.Excel97To2003);

Hi,

You can automatically detect the file format using the CellsHelper.DetectFileFormat() method.

Your code will look like this.

C#


FileFormatType fmt = CellsHelper.DetectFileFormat(filePath);


if(fmt == FileFormatType.Excel97To2003)

opts = new LoadOptions(LoadFormat.Excel97To2003);



The file was originally created in Excel97 then loaded in code through an older version of the cells component (from about nov/december last year).


That document was then saved programmatically to a file on the server and retrieved to the user using the cells component though an http context (which is why it has all the additional property information embedded).

Finally, the document was then worked on a bit more in excel 97.

Hope that helps.

Regards
Jon

Hi Jon,


Thanks for your additional comments. We will update you through this thread once the issue is resolved.

Hi,

We have fixed this issue.

Please download and try the latest fix: Aspose.Cells for .NET v7.2.1.9

The issues you have found earlier (filed as CELLSNET-40731) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.