What is the difference between Worksheet.LoadData and Worksheet.Open?

I am trying to initialise a Workbook with a spreadsheet that has been uploaded via a web browser.

I want to avoid having to save the file into a temporary folder before loading it, so I have been using the LoadData(Stream) method. This works when the orginal file was an Excel 2003 file, but when uploading an Excel2007Xlsx file, I get an error telling me I didn’t set the format correctly (and I have no parameter with which to specify what format to use).

So I started using the Open(Stream,FileFormatType) method instead, which seems to work just fine, but I am wondering what is the point of the two different methods if they do exactly the same thing.

Thank you!

R.


This message was posted using Page2Forum from LoadData Method - Aspose.Cells for .NET and Java

Hi,

Thank you for considering Aspose.

stonyuk:

I am trying to initialise a Workbook with a spreadsheet that has been uploaded via a web browser.

I want to avoid having to save the file into a temporary folder before loading it, so I have been using the LoadData(Stream) method. This works when the orginal file was an Excel 2003 file, but when uploading an Excel2007Xlsx file, I get an error telling me I didn’t set the format correctly (and I have no parameter with which to specify what format to use).

Well, I am afraid, Workbook.LoadData() method is not supported yet for Excel 2007 file format.

stonyuk:

So I started using the Open(Stream,FileFormatType) method instead, which seems to work just fine, but I am wondering what is the point of the two different methods if they do exactly the same thing.

Workbook.LoadData() method only fetches the data from the workbook. No formatting will be fetched from the workbook whereas Workbook.Open() will fetch both the data and formatting from the template workbook.

Thank You & Best Regards,