Message-ID: <273541390.9811.1711703730734.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9810_671336504.1711703730734" ------=_Part_9810_671336504.1711703730734 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Hyperlink

Hyperlink

=20

Represents a hyperlink in an Area (wh= ich may contain only one cell) that points to an external URL.

=20
C#
=20
 public sealed class Hyperlink
=20
=20
vb.net
=20
Public NotInheritable Class Hyperlink
=20
=20 =20

To create a Hyperli= nk object, call Cell.CreateHyperlink or Area.CreateHyperlink. To get an e= xisting Hyperlink, use Worksheet.Hyperlinks.

=20

A Hyperlink only represents a URL to an external resource such as a web = site. To create a link to another location in the workbook, you will need t= o use Excel's Hyperlink formula. You will need to surround the destination = cell in quotes and preface it with a pound sign. For example, a cell with f= ormula =3DHYPERLINK("#DestinationWorksheet!B3", "Link to B3&= quot;) will contain the text "Link to B3", and if you click on th= at text it will bring you to cell B3 on the worksheet named DestinationWork= sheet.

=20 =20
C#
=20

          //--- Create a hyperlink
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();
          Worksheet ws =3D wb.Worksheets[0];
          Cell cellA1 =3D ws.Cells["A1"];
          cellA1.Value =3D "SoftArtisans";
          Hyperlink link =3D cellA1.CreateHyperlink("http://www.softar=
tisans.com");

          //--- Get an existing hyperlink
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Open(@"C:\MySpreadsheet.xls");
          Worksheet ws =3D wb.Worksheets[0];
          Hyperlink firstLink =3D ws.Hyperlinks[0];

          //--- Create a link to another location within the workbook
          //--- (Note that this does NOT use the Hyperlink class)
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();
          Worksheet ws =3D wb.Worksheets[0];
          ws.Cells["A1"].Formula =3D "=3DHYPERLINK(\"#D=
estinationSheet!B3\", \"Link to other sheet\")";
        
=20
=20
vb.net
=20

          '--- Create a hyperlink
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          Dim ws As Worksheet =3D wb.Worksheets(0)
          Dim cellA1 As Cell =3D ws.Cells("A1")
          cellA1.Value =3D "SoftArtisans"
          Dim link As Hyperlink =3D cellA1.CreateHyperlink("http://www=
.softartisans.com")

          '--- Get an existing hyperlink
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          Dim ws As Worksheet =3D wb.Worksheets(0)
          Hyperlink firstLink =3D ws.Hyperlinks(0)

          '--- Create a link to another location within the workbook
          '--- (Note that this does NOT use the Hyperlink class)
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          Dim ws As Worksheet =3D wb.Worksheets(0)
          ws.Cells("A1").Formula =3D "=3DHYPERLINK("&qu=
ot;#DestinationSheet!B3"", ""Link to other sheet"&=
quot;)"
        
=20
=20 =20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

Are= a

Returns the Area= that the Hyperlink object is a= ssociated with. The set of cells that the Area object represen= ts functions as a single hyperlink to the same href.

Hre= f

Sets or returns the URL that the hyperlink link= s to.

Tex= t

Sets or returns the hyperlink's displayed text.=
------=_Part_9810_671336504.1711703730734--