OFC. - Office-Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Browser and Office (Acc.-Engine) > OFC. - Office-Commands > MS-Excel Scripting >

OFC. - Office-Commands

OFC. - Office-Commands/MS-Excel Scripting      

Previous Top Next


 

MiniRobotLanguage (MRL)

 

OFC.Excel|CLOSE

CLOSE MS-Excel worksheet via the SPR

 

 

 

Intention

Generally you will need to OPEN a Excel-Instance first, this is done using the "OPEN" Subcommand.

To Close your Excel-Instance, use the CLOSE Subcommand.

There is one Parameter, that will force Excel to close whether there are Error-Messages like "File not saved" etc. or not.

Set the Force Flag to "1" if you want to close Excel anyway.

 

The CLOSE Subcommand will only Close Excel-Instances that have previously been opened with the OPEN Subcommand of the same Robot-Instance.

The Command will drop an "1" on the TOS if it was successful, otherwise a "0".

 

 

Syntax:

 

OFC.Excel|CLOSE[|P1]

 

 

Parameter Explanation:

 

P1 - 0/1 - FORCE Flag suppress Error-Messages and force Excel to close

 

 

Example:

 

' Excel CLOSE Example

VAR.$$PFA=?path\Test.xls

OFC.excel|OPEN||0|1

DMP.6

OFC.excel|CLOSE|1

DMP.6

MBX.!

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.

The CLOSE Subcommand will only Close Excel-Instances that have previously been opened with the OPEN Subcommand of the same Robot-Instance.

If the command succeeds, it will drop an "1" on the TOS.

 

 

See also:

 

  !Excel-Scripting

  Excel_Open

  Excel_Exist