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|SENDKEY

Write to a Cell in an MS-Excel worksheet via the SPR

 

 

 

Intention

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

 

The Sendkey Subcommand will be useful to navigate inside Excel. To find the right keys to send, go into Excel manually and pres the ALT-key.

 

' Open the File-Menu

OFC.Excel|SENDKEY|"%d"

' Choose new Page

OFC.Excel|SENDKEY|"%n"

 

' Write "Hallo"

OFC.Excel|SENDKEY|Hallo

 

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

 

 

Syntax:

 

OFC.Excel|SENDKEY|P1

 

 

Parameter Explanation:

 

P1 - Characters to send. Besides normal Letters there are several special characters.

 

 

SK1

 

SK2

 

For more Details see MSDN.

 

 

 

Example:

 

' Excel WRITE Example

OFC.excel|OPEN||0|1

' Activate by name

OFC.excel|SHEET_Activate|2

' Write "Hallo"

OFC.Excel|SENDKEY|Hallo

' Open the File-Menu

OFC.Excel|SENDKEY|"%d"

' Choose new Page

OFC.Excel|SENDKEY|"%n"

MBX.Click to Close

OFC.excel|CLOSE|1

END.

 

 

Remarks:

Not all Character-Kombinations make sense using SENDKEY. You can use the Standard SPR Keyboard Simulation Features also, but the Chance that

Keys get lost are minimized if you use this Sendkey-Version, as it internally checks that no further Key is send until the Key before has been processed.

 

 

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 SENDKEY Subcommand will only work with 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