EXCEL Read Hyperlinks in C#, VB.NET

  • Demo
  • C# source
  • VB.Net source
 

The sample demonstrates how to read hyperlinks from spreadsheet.

ReadHyperlinks.gif

	private void btnRun_Click(object sender, System.EventArgs e)
		{
			Workbook workbook = new Workbook();
 
			workbook.LoadFromFile(@"..\..\..\..\..\..\Data\HyperlinkSample.xls");
            
			Worksheet sheet = workbook.Worksheets[0];

			textBox1.Text = sheet.HyperLinks[0].Address;
			textBox2.Text = sheet.HyperLinks[1].Address;
		}

		Private Sub btnRun_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRun.Click
			Dim workbook As Workbook = New Workbook()
			workbook.LoadFromFile("..\..\..\..\..\..\Data\HyperlinkSample.xls")
			Dim sheet As Worksheet = workbook.Worksheets(0)

			textBox1.Text = sheet.HyperLinks(0).Address
			textBox2.Text = sheet.HyperLinks(1).Address
		End Sub