Programmer's Reference >
ExcelApplication API >
Hyperlink
The Hyperlink Object
Represents a hyperlink in an Area (which may contain only one cell). To create a Hyperlink object, call Cell.CreateHyperlink or Area.CreateHyperlink . To get an existing Hyperlink , use Worksheet.Hyperlinks to get all the hyperlinks, then get the one you want from the collection.
Examples:
[csharp]
// Create a hyperlink
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
Worksheet ws = wb.Worksheets[0];
Cell cellA1 = ws.Cells["A1"];
cellA1.Value = "SoftArtisans";
Hyperlink link = cellA1.CreateHyperlink("http://www.softartisans.com");
// Get an existing hyperlink
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Open("@C:\MySpreadsheet.xls");
Worksheet ws = wb.Worksheets[0];
Hyperlink firstLink = ws.Hyperlinks[0];
[vbnet]
' Create a hyperlink
Dim xla As New ExcelApplication()
Dim wb As Workbook = xla.Create()
Dim ws As Worksheet = wb.Worksheets(0)
Dim cellA1 As Cell = ws.Cells("A1")
cellA1.Value = "SoftArtisans"
Dim link As Hyperlink = cellA1.CreateHyperlink("http://www.softartisans.com")
' Get an existing hyperlink
Dim xla As New ExcelApplication()
Dim wb As Workbook = xla.Create()
Dim ws As Worksheet = wb.Worksheets(0)
Hyperlink firstLink = ws.Hyperlinks(0)
Hyperlink Properties
Property |
Type |
Access |
Description |
Area |
Area
|
read |
Returns the Area that the Hyperlink object is associated with
|
Href |
String
|
read |
Sets or returns the hyperlink's href value
|
Text |
String
|
read write |
Sets or returns the hyperlink's displayed text
|
This object does not have any methods defined.
Copyright 2005 © SoftArtisans, Inc. All Rights Reserved.
|