Free Support Forum - aspose.com

workbook.LoadData() not loading Comments

Hey all,

I noticed that when using the LoadData() method to read a document that the comments in the worksheet are not loaded into the workbook.Worksheet[0].Comments object.

However when using the .Open() method they are.

My logic is being run from within a webservice so I cannot use the Open() method.. I am converting a byte[] into a MemoryStream and then using the LoadData() method.

I need to also be able to read comments in the excel file. Are there any fixes or work arounds for this?

Thanks in advance....

string path = @"C:\test.xls";

Workbook workbook = new Workbook();

workbook.LoadData(path); // LoadData does not include Comments data

//workbook.Open(path);

Cells cells = workbook.Worksheets[0].Cells;

// Reads Comments

string commentInA1 = "";

Comments comments = workbook.Worksheets[0].Comments;

if (comments["T8"] != null)

commentInA1 = comments["T8"].Note;

else

commentInA1 = "NONE";

LoadData method only load data in Excel files. Please use Open method instead.

I don't understand why you cannot use Open method.

Ahh.. I was mistaken. I did not realize that Open() also took a Stream as well. I will use that method instead.

Apologies....

That did the trick guys… As always thanks for the speedy response.