Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
add to repository
CLASS COM-EXCEPTION AS "*COM-EXCEPTION"
CLASS COM AS "*COM".
add to scriplets
WORKING-STORAGE SECTION.
01 GLOBAL-WS.
05 XLS-APP-TYPE PIC X(8192) VALUE "Excel.Application".
05 OBJ-APP OBJECT REFERENCE COM.
05 OBJ-WBKS OBJECT REFERENCE COM.
05 OBJ-WKS OBJECT REFERENCE COM.
05 OBJ-WKSS OBJECT REFERENCE COM.
05 OBJ-WBK OBJECT REFERENCE COM.
05 OBJ-RANGE OBJECT REFERENCE COM.
05 RETURN-ERROR PIC 9(9) COMP-5.
05 WINDEX PIC S9(9) COMP-5 VALUE 1.
01 W-WORKBOOK PIC X(40) VALUE "mypathname\myexcelfile.xls".
01 W-TRUE PIC S9(4) COMP-5 VALUE -1.
01 M1 PIC X(2) VALUE "A ".
01 M1-R REDEFINES M1.
05 PIC X.
05 N1 PIC 9.
01 W-VALUE1 PIC X(10).
PROCEDURE DIVISION.
INVOKE COM "CREATE-OBJECT"
USING XLS-APP-TYPE
RETURNING OBJ-APP.
INVOKE OBJ-APP "GET-WORKBOOKS"
RETURNING OBJ-WBKS.
INVOKE OBJ-WBKS "OPEN"
USING W-WORKBOOK
RETURNING OBJ-WBK
INVOKE OBJ-WBK "GET-WORKSHEETS"
RETURNING OBJ-WKSS
INVOKE OBJ-WKSS "GET-ITEM"
USING WINDEX
RETURNING OBJ-WKS
INVOKE OBJ-WKS "ACTIVATE"
INVOKE OBJ-APP "SET-Visible"
USING W-TRUE
RETURNING RETURN-ERROR.
MOVE 1 TO TO WINDEX
INVOKE OBJ-WKSS "GET-ITEM"
USING WINDEX
RETURNING OBJ-WKS
INVOKE OBJ-WKS "ACTIVATE"
INVOKE OBJ-WKS "GET-RANGE"
RETURNING
OBJ-RANGE
PERFORM VARYING N1 FROM 1 BY 1 UNTIL N1 = 9
DISPLAY "M1=" M1
INVOKE OBJ-WKS "GET-RANGE"
USING M1
RETURNING
OBJ-RANGE
INVOKE OBJ-RANGE "GET-VALUE"
RETURNING W-VALUE1
DISPLAY "M1=" M1 " VAL=" W-VALUE1 "="
END-PERFORM
INVOKE OBJ-WBK "Close".
INVOKE OBJ-APP "Quit".