Activates the workbook WorkbookName in the Microsoft Excel application.
The ReturnCode parameter is used to check whether the method was executed successfully.
Syntax | |
CALL_METHOD NameExcelClientObject WKBK_ACTIVATE NameWorkbook ReturnCode |
|
Parameters |
|
WorkbookName |
ALPHA(50) type (input parameter) |
ReturnCode |
NUM_BIN_4 type (output parameter) |
Closes the active workbook in Microsoft Excel and reads the value of the SaveChanges parameter, which instructs the system whether or not to save it.
If the workbook is saved, it will be saved to the file whose full path is contained in the FileNamePath parameter.
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 WKBK_CLOSE SaveChanges FileNamePath ReturnCode |
|
Parameters |
|
SaveChanges |
BOOL type (input parameter) |
FileNamePath |
ALPHA(260) type (input parameter) |
ReturnCode |
NUM_BIN_4 type (output parameter) |
* When exiting the window
* the workbook is closed without saving changes
SAVE_CHANGES = *FALSE
CALL_METHOD EXCEL_CLI WKBK_CLOSE SAVE_CHANGES -
FILE_PATH RETURN_CODE
VISIBLE = *FALSE
CALL_METHOD EXCEL_CLI APPL_SET_VISIBLE VISIBLE RETURN_CODE
CALL_METHOD EXCEL_CLI APPL_DISCONNECT RETURN_CODE
Creates a new workbook in the Microsoft Excel application with a worksheet of the type set in SheetType. The newly-created workbook will become the active workbook.
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 WKBK_CREATE SheetType ReturnCode |
|||
Parameters |
|||
SheetType |
NUM_BIN_2 type (input parameter) Possible values :
|
||
ReturnCode |
NUM_BIN_4 type (output parameter) |
Note: In Cloud generation, the created workbook is in Excel 97-2003 format (.xls file). The EX_WKBK_CREATE method needs to be used to create documents in OOXML format (Office Open XML) compatible with Excel 2007 and later (.xlsx file).
* Creating a new Excel workbook and worksheet
SHEET_TYPE = _EXL_WORKSHEET
CALL_METHOD EMPLOYEE_WIN.EXCEL_CLI WKBK_CREATE SHEET_TYPE RETURN_CODE
Create a new workbook in the Microsoft Excel application with a document format specified in FileFormat and with a sheet type specified in SheetType. The created workbook becomes the active workbook
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 WKBK_CREATE_EX SheetType FileFormat ReturnCode |
|||||
Parameters |
|||||
SheetType |
NUM_BIN_2 type (input parameter) Possible values :
|
||||
FileFormat |
NUM_BIN_2 type (input parameter) Possible values :
|
||||
ReturnCode |
NUM_BIN_4 type (output parameter) |
Note: This method is not implemented in Windows generation.
Retrieves a workbook into a variable in a Visual Adelia application, using the following parameters:
WorkbookName |
name of the workbook to be retrieved, |
Target |
variable into which the workbook is to be retrieved, |
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 WKBK_GET WorkbookName Target ReturnCode |
|
Parameters |
|
WorkbookName |
ALPHA(50) type (input parameter) |
Target |
IMAGE type (output parameter) |
ReturnCode |
NUM_BIN_4 type (output parameter) |
Creates a workbook in Microsoft Excel under the name contained in the Source variable in a Visual Adelia 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 WKBK_LOAD Source ReturnCode |
|
Parameters |
|
Source |
IMAGE type (input parameter) |
ReturnCode |
NUM_BIN_4 type (output parameter) |
Opens a workbook in the Microsoft Excel application, using the full path contained in FileNamePath.
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 WKBK_OPEN FileNamePath ReturnCode |
|
Parameters |
|
FileNamePath |
ALPHA(260) 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
Prints the specified pages of the active workbook 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.
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 WKBK_PRINT_OUT FromPage ToPage NbCopies ReturnCode |
|||||
Parameters |
|||||
FromPage |
NUM_BIN_2 type (input parameter) |
||||
ToPage |
NUM_BIN_2 type (input parameter) Possibles values:
|
||||
NbCopies |
NUM_BIN_2 type (input parameter) |
||||
ReturnCode |
NUM_BIN_4 type (output parameter) |
Note: This method is not implemented by the Cloud generator.
Saves the active workbook to a back-up support.
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 WKBK_SAVE ReturnCode |
|
Parameters |
|
ReturnCode |
NUM_BIN_4 type (output parameter) |
Saves the active workbook to a back-up support using the path and filename specified in FileNamePath.
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 WKBK_SAVE_AS FileNamePath ReturnCode |
|
Parameters |
|
FileNamePath |
ALPHA(260) 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