What's the better way to insert cell comments in excel 2007 files programmaticaly using c# and .net 3.5?
A:
Have you tried using VSTO ? You can easily load an Excel document and manipulate it. To add a comment to a cell, load the file, activate the worksheet, then select the cell as a range and set the comment.
Alexandre Brisebois
2008-10-21 17:56:39
+4
A:
I just did exactly that but with MS Word (using Microsoft.Office.Interop.Word
range.Comments.Add ( range, ref _categoryMessage );
So, I would suggest using Microsoft.Office.Interop.Excel and the similar method. Consider this from MSDN:
http://msdn.microsoft.com/es-es/library/microsoft.office.interop.excel.range.addcomment.aspx
Also see this too
kenny
2008-10-21 17:59:35
probably need to play with the editor to get the whole link to work
Lance Roberts
2008-10-21 18:26:44
Thanks, Kenny.But when i do this my program is starting a process called excel. Does it means i need to have ms excel installed on my computer?
Adones Cunha
2008-10-21 20:18:58
Yes. Sorry, these interop calls require Excel.
kenny
2008-10-22 11:14:52
Something also worth mentioning is that there are no Excel library redistributables when you use the Interop.Excel. So users of the application also need to have Excel installed on their machine.If you need to write the application for targets that don't have Excel installed locally, you need to modify the .xml directly. I believe there are some good utilities for this out there.
JettGeek
2010-01-14 15:49:08
A:
hi! have you solved it? i'm trying to add comments without using the VSTO and i can't achieve it. Could you help me? thanks! Ariel
Ariel
2010-07-27 16:48:46