I\'m using VSTO to create an Excel Add-on. This add-on retrieves and display alot of data from a sql-server. This works great, but later on I plan to access some of the data ins
AMissico listed some very good solutions. I'd like to add one that worked for me:
In C# (ExcelDNA/VSTO) or VBA you can do something like:
var app = (Application) ExcelDnaUtil.Application;
app.ActiveCell.AddComment("This is an editable cell");
The obvious drawback would be that the user can see this comment - in my case it worked out very well because I could provide useful diagnostics to the user, and also parse the same text to get the meta-data I wanted.
You can also hide the comment using:
app.DisplayCommentIndicator = XlCommentDisplayMode.xlNoIndicator;
However, note that this hides all comments, not just the one you added. To iterate over comments in a sheet, you can use the following:
var comments = ((Worksheet)app.ActiveSheet).Comments;
foreach(Comment comment in comments)
{
var text = comment.Text();
// do something...
}