Cant Read Comments

Hi,

We are currently evaluating this software, but we have run into some difficulty:

we have an excel spreadsheet which we have added a comment to cell A1 using microsoft excel 2000.

we used the following code snippet to try and read the comment into our program:

Aspose.Excel.Excel excel = new Aspose.Excel.Excel();
Aspose.Excel.Comment cmt;
excel.Open(@"C:\Work\Testing\Allsorts\Comments.xls");
cmt = excel.Worksheets[0].Comments["A1"];
String x= cmt.Note;

but this code doesnt not work, cmt is null by the time we get to the line

String x= cmt.Note;

It is critical that this works, if we are to purchase this software.

please can you provide some assistance.

many thanks.

@blaggard,
Aspose.Cells is the latest product that has replaced Aspose.Excel and is much advanced in terms of features and performance. Aspose.Cells not only supports old style notes but also supports the latest threaded comments. Following sample codes can be used to test these features.

Managing old style notes

// Instantiating a Workbook object
Workbook workbook = new Workbook();

// Adding a new worksheet to the Workbook object
int sheetIndex = workbook.Worksheets.Add();

// Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[sheetIndex];

// Adding a comment to "F5" cell
int commentIndex = worksheet.Comments.Add("F5");

// Accessing the newly added comment
Comment comment = worksheet.Comments[commentIndex];

// Setting the comment note
comment.Note = "Hello Aspose!";

// Setting the font size of a comment to 14
comment.Font.Size = 14;

// Setting the font of a comment to bold
comment.Font.IsBold = true;

// Setting the height of the font to 10
comment.HeightCM = 10;

// Setting the width of the font to 2
comment.WidthCM = 2;

// Saving the Excel file
workbook.Save(dataDir + "book1.out.xls");

Managing threaded comments

Workbook workbook = new Workbook();

// Add Author
int authorIndex = workbook.Worksheets.ThreadedCommentAuthors.Add("Aspose Test", "", "");
ThreadedCommentAuthor author = workbook.Worksheets.ThreadedCommentAuthors[authorIndex];

// Add Threaded Comment
workbook.Worksheets[0].Comments.AddThreadedComment("A1", "Test Threaded Comment", author);

workbook.Save(outDir + "AddThreadedComments_out.xlsx");

Refer to the following articles for detailed information on this topic:
Managing Comments
Threaded Comments

Product features can be tested using the following trial version:
Aspose.Cells for .NET (Latest Version)

Here is a complete solution that can be used for testing different features of the product.