[Stackoverflow] [Progress OpenEdge ABL] Copying Excel active sheet to the end of the workbook with Progress 4GL

Status
Not open for further replies.
N

Newbie

Guest
I'm trying to copy an Excel active sheet to the end of the workbook with Progress 4GL. This is what I've tried so far.

Code:
DEFINE VARIABLE chExcelApplication   AS COM-HANDLE.    /* com-handle for the application */
DEFINE VARIABLE chWorkbook           AS COM-HANDLE.    /* com-handle for the workbook */
DEFINE VARIABLE iSheetCount          AS INTEGER.       /* variable to track the current sheet count */

CREATE "Excel.Application" chExcelApplication.
chWorkbook = chExcelApplication:Workbooks:Open("C:\tmp\test.xlsx").

iSheetCount = chWorkbook:sheets:COUNT.

chWorkbook:Sheets(1):COPY:after = chWorkbook:Sheets(iSheetCount).

This is the relevant VBA code:

Code:
Sheets(1).Copy After:=Sheets(Sheets.Count)

A quick return for iSheetCount itself already giving the correct number of worksheets. How do phrase the Copy After on VBA into Progress 4GL?

Continue reading...
 
Status
Not open for further replies.
Top