EXCEL Read Comment in C#, VB.NET

  • Demo
  • C# source
  • VB.Net source

The sample demonstrates how to read comment from an excel workbook.


		private void btnRun_Click(object sender, System.EventArgs e)
			Workbook workbook = new Workbook();
			//Initialize worksheet
			Worksheet sheet = workbook.Worksheets[0];

			textBox1.Text = sheet.Range["A1"].Comment.Text;
			richTextBox1.Rtf = sheet.Range["A2"].Comment.RichText.RtfText;

		Private Sub btnRun_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRun.Click
			Dim workbook As Workbook = New Workbook()

			'Initialize worksheet
			Dim sheet As Worksheet = workbook.Worksheets(0)

			textBox1.Text = sheet.Range("A1").Comment.Text
			richTextBox1.Rtf = sheet.Range("A2").Comment.RichText.RtfText
		End Sub