Description: | Executes the Excel open command to open an existing book. Starts Excel if Excel is not running. |
Used in controls: | ExcelConnection |
Used in objects: | None. |
Parameters: | VT_BSTR - BookNameX(8192) [VT_I4 - SheetIndexS9(9) COMP-5] |
Description of Parameters: | BookName: The name of the Excel book to open. SheetIndex: The index of the sheet to connect to within the Excel book. Data is exchanged with this sheet, however, the sheet is not selected in Excel. |
Return value: | VT_I4 - ReturnValueS9(9) COMP-5 Zero or greater indicates normal completion. |
Example: | WORKING-STORAGE SECTION. 01 ExcelBookName PIC X(20). 01 ExcelSheetIndx PIC S9(9) COMP-5. 01 ReturnValue PIC S9(9) COMP-5. PROCEDURE DIVISION. * Opens the "my.xls" book and goes * to page 2 MOVE "C:\my.xls" TO ExcelBookName MOVE 2 TO ExcelSheetIndx INVOKE CmExcel1 "OpenBook" USING ExcelBookName ExcelSheetIndx RETURNING ReturnValue |
Backward compatibility | OPENEXCELSHEET |
Backward compatibility | X(260) |