Read/Write Comment from cell in Excel

Is it possible to read/write comments like we read/write cell values in excel application scope.
Please share if some extra packages need to be included. I have tried with Microsoft.Office.Interlop unable to get right functions to be used.


From where yo want to Read/Write comments ?

1 Like

From cell in Excel

Hi guys, Is there any update or solution come out?

Hi!. it’s a simple task for Microsoft.Office.Interop.Excel.

  • install Microsoft.Office.Interop.Excel from nuget
  • import namespace Microsoft.Office.Interop.Excel to UiPath
  • use my simple project(set your path to Excel File) and excel file for reading comment (25.9 KB)
testComment.xlsx (9.5 KB)

Hello Ivanco ,

I am not so familiar with C# code you have used in attached xaml. Could you please help me with the If condition , that even if the cell does not have any comment or note it should not throw any error.


Hello @pakankshabha
use this simple code for your task:

string myComment;
 if( range.Comment != null)
 	myComment = range.Comment.Text();
 	myComment = "Comment is null!";

Thank you Ivanco for quick reply. I will try this.