You can use a named range to reference a location on your worksheet. The worksheet has to be open when you compile the script, however, or the Claris Resolve compiler will assume it's a script. If this occurs, you will get a "Missing Script" message when the script is executed.
Example:
* Create a worksheet named "MyWorksheet".
* Save it to the root directory of your hard disk.
* Select the cell or your choice.
* Choose "Name Ranges..." from the Format menu.
* Type "myrange" into the name field.
* Click OK.
* Save it to the root directory of your hard disk.
* Close the worksheet.
* Choose "New Script" from the Script menu to create a new script.
* Enter the following commands (replace <HD> with the name of your hard disk:
Open "<HD>:MyWorksheet"
Put 999 into MyWorksheet:myrange
* Save the script to the root directory of your hard disk.
* Choose "Run" from the Script menu.
You should get an error saying "Missing Script". This is because the script was compiled with the worksheet that contained the named range closed. Remember that scripts are compiled when you save, compile or run them.
To correct the problem:
* Open the worksheet named "MyWorksheet".
* Bring the script window to the front by choosing its name ("Script1") from the View menu.
* Choose "Compile" from the Script menu.
* Close "MyWorksheet" leaving the script open.
* Choose Run from the Script menu.
The script should now run correctly with no errors since we re-compiled it with the worksheet open.