Opens an EXCEL Workbook.
The Excel application must first have been opened with EXCELOPEN.
Syntax
CHGVAR |
VAR(&CMD) VALUE('XLOPENFILE') |
CHGVAR |
VAR(&PARM1) VALUE('File path') |
CHGVAR |
VAR(&PARM2)
VALUE(' [;PWD="password"] |
CALL |
PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 + &PARM2 &RESULT) |
Paramètres
Parameters |
|
Parm1 |
Path and name of the file to open. If only the file is specified, it will be opened in the default directory of EXCEL documents.
|
Parm2 |
Parm2 allows to set properties of for opening.
Properties : Text: to
open the file in text mode. The file must have the same format as the one
created by LAUNCHER Office (CSV format). ReadOnly: to
open the file read-only. AddToWorkbook: to add
the read file to the current workbook, as a new sheet. Name: allows you to name the new worksheet if the AddToWorkbook option is also selected. New: Creates a blank workbook. Visible: makes the instance of Excel visible.
|
Note
By specifying the Text option, LAUNCHER Office will check if there is a LFD file, which would have been created during the file transfer. This repeats the description of the AS/400 file to reproduce it in the workbook.
Examples
CHGVAR |
VAR(&CMD) VALUE('XLOPENFILE') |
CHGVAR |
VAR(&PARM1) VALUE('%LNCDIR%\Docs\fichier.xlsx') |
CHGVAR |
VAR(&PARM2) VALUE(' ') |
CALL |
PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 + &PARM2 &RESULT) |
In this example, the file will be opened from the Launcher installation directory.
CHGVAR |
VAR(&CMD) VALUE('XLOPENFILE') |
CHGVAR |
VAR(&PARM1) VALUE(' ') |
CHGVAR |
VAR(&PARM2) VALUE('New;Visible') |
CALL |
PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 + &PARM2 &RESULT) |
In this example, a new workbook will be created and made visible.
LNCCMD CMD(EXCELOPEN)
LNCCMD CMD(XLOPENFILE) PARM1('C:\A\base.xlsx')
In this example, a workbook is opened after having created an instance of the Excel application.
LNCCMD CMD(EXCELOPEN) LNCCMD CMD(XLOPENFILE) PARM1('%TEMP%\LNC002.TXT') + PARM2('AddToWorkbook;Name="Customers"')
In the example above, the file "LNC002.TXT" is added to the current workbook as "Customers".
LNCCMD CMD(EXCELOPEN)
LNCCMD CMD(XLOPENFILE) PARM1('C:\A\protected_workbook.xlsx')
PARM2('PWD="aura"')
In the example above, we open a protected workbook by specifying the password.
See also
• XLSAVEAS