Products Downloads


French version


 

Activates the worksheet SheetName in the active workbook in the Microsoft Excel application. This worksheet will be placed in the workbook foreground.

The ReturnCode parameter will be set to "0" if the method was executed successfully, and to a value other than "0" in the event of a problem.

Syntax

CALL_METHOD NameExcelClientObject WKSH_ACTIVATE SheetName ReturnCode

Parameters

SheetName

ALPHA(50) type (input parameter)

ReturnCode

NUM_BIN_4 type (output parameter)

* At the beginning of the program

* Connecting to Excel

CALL_METHOD EXCEL_CLI APPL_CONNECT RETURN_CODE

* Opening an existing model of workbook to be updated

FILE_PATH = 'D:\production\client\obj\employees.xls'

CALL_METHOD EXCEL_CLI WKBK_OPEN FILE_PATH RETURN_CODE

* Saving as another workbook in order not to replace the model

FILE_PATH = 'D:\production\client\obj\employees_lst.xls'

CALL_METHOD EXCEL_CLI WKBK_SAVE_AS FILE_PATH RETURN_CODE

* Positioning in the Employees worksheet

SHEET_NAME = 'Employees'

CALL_METHOD EXCEL_CLI WKSH_ACTIVATE SHEET_NAME RETURN_CODE

 

 

Adds a worksheet to the active workbook in the Microsoft Excel application, according to the following parameters:

Position

position of the worksheet to be added,

SheetNamePos

name of the sheet used for positioning; this must be completed if Position is set to "_EXL_POSITION_BEFORE" or "_EXL_POSITION_AFTER",

NewSheetName

name of the new worksheet,

SheetType

type of worksheet to be added to the new workbook.

The name of the new worksheet ( NewSheetName ) must be different from those of any sheets already in the workbook, otherwise a default name will be used. The newly-added sheet will become the active sheet.

The ReturnCode parameter will be set to "0" if the method was executed successfully, and to a value other than "0" in the event of a problem.

Syntax

CALL_METHOD NameExcelClientObject WKSH_ADD Position SheetNamePos NewSheetName SheetType ReturnCode

Parameters

Position

NUM_BIN_2 type (input parameter)

Possible values:

An index

lies between 1 and the number of sheets in the workbook.

_EXL_POSITION_BEFORE

adds the sheet before the sheet specified in SheetNamePos .

_EXL_POSITION_AFTER

adds the sheet after the sheet specified in SheetNamePos .

_EXL_POSITION_CURRENT

adds the sheet in the place of the current sheet.

_EXL_POSITION_FIRST

adds the sheet as the first sheet in the workbook.

_EXL_POSITION_LAST

adds the sheet as the last sheet in the workbook.

SheetNamePos

ALPHA(50) type (input parameter)

NewSheetName

ALPHA(50) type (input parameter)

SheetType

NUM_BIN_2 type (input parameter)

_EXL_WORKSHEET

worksheet.

ReturnCode

NUM_BIN_4 type (output parameter)

 

 

Calculates the active worksheet in the Microsoft Excel application.

The ReturnCode parameter will be set to "0" if the method was executed successfully, and to a value other than "0" in the event of a problem.

Syntax

CALL_METHOD NameExcelClientObject WKSH_CALCULATE ReturnCode

Parameters

ReturnCode

NUM_BIN_4 type (output parameter)

 

 

Moves the active worksheet in the Microsoft Excel application, using the following parameters:

Position

new position of the worksheet,

SheetNamePos

name of the sheet used for positioning; this must be completed if Position is set to "_EXL_POSITION_BEFORE" or "_EXL_POSITION_AFTER".

 

The ReturnCode parameter will be set to "0" if the method was executed successfully, and to a value other than "0" in the event of a problem.

 

Syntax

CALL_METHOD NameExcelClientObject WKSH_MOVE Position SheetNamePos

Parameters

Position

NUM_BIN_2 type (input parameter)

Possible values:

An index

lies between 1 and the number of sheets in the workbook.

_EXL_POSITION_BEFORE

moves the sheet before the sheet specified in SheetNamePos .

_EXL_POSITION_AFTER

moves the sheet after the sheet specified in SheetNamePos .

_EXL_POSITION_FIRST

the sheet becomes the first sheet in the workbook.

_EXL_POSITION_LAST

the sheet becomes the last sheet in the workbook.

SheetNamePos

ALPHA(50) type (input parameter)

ReturnCode

NUM_BIN_4 type (output parameter)

 

 

Prints the pages in the active worksheet to Microsoft Excel's default printer according to the following parameters:

FromPage

number of the first page to be printed,

ToPage

number of the last page to be printed,

NbCopies

number of copies to be printed.

 

Any blank pages will be excluded from the page numbering scheme.

 

Syntax

CALL_METHOD NameExcelClientObject WKBK_PRINT_OUT FromPage ToPage NbCopies ReturnCode

Parameters

FromPage

NUM_BIN_2 type (input parameter)

ToPage

NUM_BIN_2 type (input parameter)

Possible values for the last page number:

An integer

less than or equal to the number of pages in the workbook,

_EXL_ALL_PAGES

all pages with a number greater than or equal to the number of the first page are printed.

NbCopies

NUM_BIN_2 type (input parameter)

ReturnCode

NUM_BIN_4 type (output parameter)

 

 

Sets the background picture used for the active worksheet in the Microsoft Excel application in the file whose full path is specified in FileNamePath . This picture will not be printed when pages are printed out.

The ReturnCode parameter will be set to "0" if the method was executed successfully, and to a value other than "0" in the event of a problem.

Syntax

CALL_METHOD NameExcelClientObject WKSH_SET_BACKGROUND_PICTURE FileNamePath ReturnCode

Parameters

FileNamePath

ALPHA(260) type (input parameter)

ReturnCode

NUM_BIN_4 type (output parameter)

 

 

Sets the name ( SheetName ) of the active worksheet in the Microsoft Excel application. It must not have the same name as any other sheets in the workbook.

Syntax

CALL_METHOD NameExcelClientObject WKSH_SET_NAME SheetName ReturnCode

Parameters

SheetName

ALPHA(50) type (input parameter)

ReturnCode

NUM_BIN_4 type (output parameter)

 

 

 

 

↑ Top of page