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

 Check if a sheet already exists in the active workbook.

 

Syntax

 

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

CHGVAR                VAR(&PARM1)VALUE('SheetName')

CHGVAR                VAR(&PARM2)VALUE(' ')

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

                      &PARM1 &PARM2 &RESULT)

 

Parameters

Parameters

 

Parm1

The name of the sheet to search.

 

RESULT

If the sheet exists, the value TRUE is returned. Otherwise, FALSE is returned.

You can get the value by testing the RESULT variable.

 

 

Example

   DCL        VAR(&RESULT) TYPE(*CHAR) LEN(512)                

                                                               

   LNCOPEN                                                     

                                                               

   LNCCMD     CMD(EXCELOPEN)                                   

                                                               

   LNCCMD     CMD(XLOPENFILE) PARM1('C:\A\temp.xlsx')       

                                                               

   LNCCMD     CMD(EXCELSHOW)                                   

   LNCCMDR    CMD(XLEXISTSH) PARM1('tab') RESULT(&RESULT)      

   LNCCMD     CMD(NOP) PARM1(&RESULT)  

 

See also

CHKFILE