PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > XLSETPROP command
XLSETPROP command

Sets the value of a property of various objects (workbook, sheet, cell, or selection) on an instance of Excel.

 

Syntax

 

CHGVAR                VAR(&CMD)VALUE('XLSETPROP')

CHGVAR                VAR(&PARM1)VALUE('Property path')

CHGVAR                VAR(&PARM2)VALUE('Value')

CALL                  PGM(LNCCMD) PARM(&HANDLE &CMD &OPT +

                      &PARM1 &PARM2 &RESULT)

 

Parameters

 

Parameters

 

Parm1

 

 

 

 

 

 

 

Parm2


The full path to the property to edit.

Example: ActiveCell.Font.Color

Some examples:
ActiveCell.Font.Color: Change the color
ActiveCell.Font.Bold: Allows bold/non-bold selection.

 

Value to assign to the property.

Examples:

TRUE: True value.

FALSE: False value.

INT(string): When Excel expects an integer value.

 

 

Note

 

The path to the property follows the syntax used in Visual Basic.

You can use the constant values of Excel, such as xlBottom, xlVAlignCenter.

When the path to the property includes an element of a collection (such as ActiveCell.Borders ..., which has 4 borders), the item must be specified.

For example, in the case of borders, in Visual Basic, the property is expressed by:
ActiveCell.Borders(xlBottom).LineStyle = xlDashDot

In Visual Basic, Item is a default property that is not in the syntax.

 

Example

 

Red is set as font color of the active cell :

 

CHGVAR                VAR(&CMD)VALUE('XLSETPROP')

CHGVAR                VAR(&PARM1)VALUE('ActiveCell.Font.Bold')

CHGVAR                VAR(&PARM2)VALUE('INT(255)')

CALL                  PGM(LNCCMD) PARM(&HANDLE &CMD &OPT +

                      &PARM1 &PARM2 &RESULT)