LinkTo PowerScript function
Description
Establishes a link between an OLE control and a file or an
item within the file.
Syntax
1 |
<span>olecontrol</span>.<span>LinkTo</span> ( <span>filename </span>{, <span>sourceitem</span> <span></span>} ) |
Argument |
Description |
---|---|
olecontrol |
The name of the OLE control in which |
filename |
A string whose value is the file name |
sourceitem (optional) |
A string that names an item within file |
Return Values
Integer. Returns 0 if it succeeds and
one of the following negative values if an error occurs:
-
-1 File not
found -
-2 Item not found
-
-9 Other error
If any argument’s value is null,
LinkTo returns null.
Examples
This example creates an object in the OLE control, ole_1.
The object is linked to the file C:XLSEXPENSE.XLS:
1 |
integer result |
1 |
result = ole_1.<span>LinkTo</span>("c:xlsexpense.xls") |
This example links to a section of rows and columns
in the same spreadsheet as in the previous example:
1 |
integer result |
1 |
result = ole_1.<span>LinkTo</span>("c:xlsexpense.xls", & |
1 |
"R1C1:R5C5") |