Set Workbook Address

Sets the selected cell on an Excel spreadsheet and defines cursor behavior when reading from and writing to the spreadsheet.

 

Input Arguments

 

0

Integer

Workbook Handle

The handle for the workbook returned from the Open Workbook File command.

1

Workbook Address Mode Type

Addressing Mode

Indicates how you would like to indicate the new selected cell (see Remarks).

2

String

Absolute Position Worksheet Name

The name of the worksheet you would like to be active (applies to “Absolute Position” addressing mode only).

3

String

Absolute Position Column (A, B, C, ...)

The column containing the cell you would like to select (applies to “Absolute Position” addressing mode only).

4

Integer

Absolute Position Row (1, 2, 3, ...)

The row containing the cell you would like to select (applies to “Absolute Position” addressing mode only).

5

Move Direction Type

Relative Move Direction

The direction in which to move the cell cursor (relative to the currently-selected cell). Applies to the “Relative Move” addressing mode only.

6

Integer

Relative Move # Cells

The number of cells to move in the relative move direction, relative to the currently-selected cell). Applies to the “Relative Move” addressing mode only.

7

String

Named Cell/Range in Workbook

The name of a cell or range in a workbook to move to (applies to “Named Cell/Range in Workbook” addressing mode only).

8

Write Mode Type

Write Mode

Indicate whether you would like to insert new cells when writing, or overwrite the cell’s contents (see Remarks).

9

Move Direction Type

Auto Move Direction

The direction that the cell cursor should automatically move after a cell is read or written to.

10

Integer

Auto Move # Cells

The number of cells the cursor should automatically move by after a cell is read or written to.

 

Return Arguments

None.

 

Returned Status

 

SUCCESS

The cell was selected successfully.

FAILURE

The workbook handle was invalid, or the named cell/range was not found.

 

Remarks

There are four addressing modes:

If a worksheet name is specified that does not already exist, a new worksheet with that name will be created.

Insert write mode shifts the current cell (and those below it) downward in order to add the data. Overwrite mode replaces the cell’s existing contents.

Anytime data is read from a cell or written to a cell, an “auto move” (see argument 9) takes place. Therefore, after reading or writing to cell C8, the selected cell will be C9 (assuming the Move Direction Type is Down and the Auto Move # Cells argument is 1).