<< Click to Display Table of Contents >> Navigation: 3. Script Language > Browser and Office (Acc.-Engine) > OFC. - Office-Commands > MS-Excel Scripting > OFC. - Office-Commands |
MiniRobotLanguage (MRL)
OFC.Excel|OPEN
OPEN or CREATE NEW MS-Excel worksheet via the SPR
Intention
Generally you will need to OPEN a Excel-Instance first, this is done using the "OPEN" Subcommand.
There are two parameters which can be changed to have Excel open in FULL-SCREEN Mode, or to open an invisible Instance.
If the command succeeds, it will drop an "1" on the TOS.
To Close your Excel-Instance, use the CLOSE Subcommand.
To Open an Instance of Excel, which does not load any worksheet, use:
OFC.excel|OPEN||0|1
Syntax:
OFC.Excel|OPEN|P1[|P2][|P3]
Parameter Explanation:
P1 - (optional) Filename of the XLS-File to open, can be any file that Excel can open.
P2 - (optional) 0/1 Fullscreen or Normal Window
P3 - (optional) 0/1 Visibility - if this is "0" then Excel will open invisible.
Example:
' Excel OPEN Example
VAR.$$PFA=?path\Test.xls
OFC.excel|OPEN|$$PFA|0|1
' Activate by name
OFC.excel|SHEET_Activate|2
OFC.excel|WRITE|A3:A4|44
OFC.excel|CLOSE|1
END.
Remarks:
To Close your Excel-Instance, use the CLOSE Subcommand.
However, its not necessary to close an Excel File, if you want to leave it open, even after the SPR exits.
Limitations:
These commands need an valid Installation of MS-Office Excel. It will check if MS Excel is properly installed, and if not just do nothing.
See also: