4.7.1 Inserting Links into Worksheet CellsInsLink-to-WksCell
URL Links
Inserting URL Links into Worksheet Cells
To insert live links into worksheet cells, simply begin URLs with http://. The link will become active when you finish editing, and will open in a web browser when clicked.

To insert a link with display text different from the URL, use the following syntax:
URL DisplayedText
Note the white space between the URL and the displayed text.
For example, if you enter http://www.originlab.com here, the word “here” appears in the cell. When clicked, a web browser opens to the OriginLab website.

Inserting URL Links into Graphs
You can also insert hyperlinked text objects into graphs:
- Click the Text Tool button
on the Tools toolbar. Place the cursor in the graph and type OriginLab.
- Right-click the text, and then select Programming Control...

- In the Script, Run After drop-down menu, select None. In the text box below, type http://www.originlab.com. The text will now appear as a live link, and will open a browser to the OriginLab website when clicked.

- To make the text label appear as a button, select Button Up from the Script, Run After drop-down menu, and then enter either of the following commands in the text box.
run -lk "URL"
- or
win -aw "URL"


- Click OK to close the dialog.
Internal Links
Inserting Internal Links into Worksheet Cells
To insert internal links to ranges, begin with range://, and then follow with book, sheet, and column information, using the syntax in these examples:
- range://[book1]sheet2
- This will activate Sheet 2 in Book 1.
- range://[book1]sheet2!col(2)[10]
- This will activate Sheet 2 in Book 1; the tenth row of the second column will display at the top of the worksheet.

To display text that differs from the actual link, use this syntax:
InternalLink DisplayedText
Note the white space between the internal link and the displayed text.
For example, if you enter range://[book1]sheet2 here, the word “here” appears in the cell. When clicked, sheet 2 of book 1 is activated.

Inserting Internal Links into Graphs
You can also use a text label with an internal link to activate a range of data:
- Click the Text Tool button
on the Tools toolbar. Place the cursor in the graph and type Sheet2, column2 ,row10.
- Right-click the text, and then select Programming Control....

- In the Script, Run After drop-down menu, select None. In the text box below, type the internal link range://[Book1]sheet2!col(2)[10]. The text will now appear as a live link, and when clicked will activate Sheet 2 in Book 1 at the tenth row of column 2.

- To make the text appear as a button, select Button Up from the Script, Run After drop-down menu, and then enter the following command:
run -lk "range://[Book1]sheet2!col(2)[10]"

Links to Show Contents From Other Cell
In one cell, to show contents from other cell, begin with cell://, and then follow with the cell information. Syntax is like this example:
- cell://[book1]sheet2!col(A)[1]
- The contents in the first cell of column A in the sheet2 of book1 will be displayed in the current cell.

When a link refers to a cell in the same sheet, you can omit the Book and Sheet reference:
- cell://col(A)[1]
or even more simply as
- cell://A[1]
Similarly, you can reference another sheet in the same book with:
- cell://sheet3!C[10]
 | Origin 2018 SR0 and later support a simplified notation for displaying numeric content from other cells and performing cell-level calculations. To learn more, see Using a Formula to Set Cell Values.
|
Help Link
Inserting Help Links into Worksheet Cells
To insert links to Origin Help documents, begin with help://, and then follow with the link to the Help page. For example:
Help://TUTORIAL.CHM/Tutorial/Import_Wizard.html

The link will become active when you finish editing, and will open in a web browser when clicked.
To insert a link with display text different from the URL, use the following syntax:
HelpLink DisplayedText
Note the white space between the Help link and the displayed text.
For example, if you enter help://TUTORIAL.CHM/Tutorial/Import_Wizard.html here, the word “here” appears in the cell. When clicked, a web browser opens to the Import Wizard page in the Origin Help document.:
Inserting Help Links into Graphs
You can also insert hyperlinked text objects into graphs:
- Click the Text Tool button
on the Tools toolbar. Place the cursor in the graph and type OriginLab.
- Right-click the text, and then select Programming Control...

- In the Script, Run After drop-down menu, select None. In the text box below, type help://TUTORIAL.CHM/Tutorial/Import_Wizard.html. The text will now appear as a live link, and will open a browser to the Import Wizard page in the Origin Help document.

- To make the text label appear as a button, select Button Up from the Script, Run After drop-down menu, and then enter the appropriate code in the text box. For example:
run -lk "help://TUTORIAL.CHM/Tutorial/Import_Wizard.html""
- Click OK to close the dialog.

Links to LabTalk Variables
To insert a link to a LabTalk variable, use the following syntax:
var://VariableName
For example, the value of the variable MyVar is 3.14. If you enter var://MyVar in a worksheet cell, you will see 3.14 displayed. The displayed value changed with the value of the variable.

If the LabTalk variable is a string variable, the following syntax can be used also:
str://StringVariableName$
For example, the value of the variable MyBook$ is Book7. If you enter str://MyBook$ or var://MyBook$ in a worksheet cell, you will see Book7 displayed. The displayed value changes with the value of the variable.

Note: These var:// and str:// notations only work with the old "col(N)" syntax -- not the newer spreadsheet cell notation that was introduced in Origin 2017 SR0.
Note that the older notation supports cell-level calculations using var:// as in:
var://max(col(A))*2 //find the max value in column A and multiply by 2
However, there is a new-and-improved notation for doing such cell-level calculations. For more information, see Using Formulas to Set Cell Values.
|
Links to Graph/Matrix/Notes Windows
Links to Graph Window
To manually add a link to a graph window into a worksheet cell, use the syntax:
graph://GraphName
This inserts a linked image of the graph into the cell. Double-clicking on the cell activates the graph window.

A better method for linking to a graph window is to right-click on the worksheet cell and choose Insert Graph. This opens the insertGraph dialog box. Expand the Options branch and disable Move Graph to cell [Embedding]. The advantage of this method is that you can choose other options for displaying the linked graph.
Links to Matrix Window
To add a link to a matrix window into a worksheet cell, use the syntax:
matrix://[MatrixBookName] // link to matrixbook
matrix://[MatrixBookName]MatrixSheetName! // link to matrixsheet
matrix://[MatrixBookName]MatrixSheetName!MatrixObjectNumber // link to matrix object
For example, there is a matrix object in matrixsheet of matrixbook, named [MBook1]MSheet1!1, then add matrix://[MBook1]MSheet1!1 into a worksheet cell, then this cell will show the image mode (like a thumbnail) of the matrix object. If double-click on this cell, the matrix object will be activated.

Links to Notes Window
To manually add a link to an existing Notes window into a worksheet cell, use the syntax:
notes://NotesName
For example, there is a Notes window named Notes, then add notes://Notes into a worksheet cell, then a link is available to this Notes window. If click on this link, the Notes window will be activated.

To simultaneously create and link to a new Notes window, simply right-click on a worksheet cell and choose Insert Notes from the shortcut menu.
Note links support a DisplayedText option similar to range and http.
Links to Image File
The following syntax is used to link an image file into a worksheet cell, and the image will display in the worksheet cell.
file://ImagePath
For example, there is an image file located in E:\ drive, and named Flower.jpg. Then add file://E:\Flower.jpg into a worksheet cell, and the image will show there.

Related Topics
|