Site icon Kaizen.Personal computer work.

Set hyperlink.(Microsoft Excel Office Scripts)

Japanese version.

Introduction to setting up hyperlinks to cells (on the Web, in documents) with Office scripts.

Operations

The following syntax is used (Red text indicates variable parts)

// Link to Web site
workbook.getWorksheet("Sheet").getRange("Cell address").setHyperlink({
    address: "Linked URL",
    textToDisplay: "Cell value",
    screenTip: "Callout (tooltip) on mouseover"
});

// Link in document
workbook.getWorksheet("Sheet").getRange("Cell address").setHyperlink({
    documentReference: "Linked cell address",
    textToDisplay: "Cell value",
    screenTip: "Callout (tooltip) on mouseover"
});

For links to Web sites, the address property is the URL of the link destination,

For intra-cell links, set the destination cell address to the documentReference property.

In common, set the value of the cell in the textToDisplay property,

screenTip property is set to the content of the callout (tooltip).

In the following code, cell A1 contains the link to the Web site,

A2 cell is an example of setting a link to a document.

For those who want to learn Office script effectively

The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Excel Office Script to streamline your workflow.

Links

Office Scripts Articles

Exit mobile version