forked from ggreen86/XLSX-Workbook-Class
-
Notifications
You must be signed in to change notification settings - Fork 1
/
testextract.prg
24 lines (23 loc) · 894 Bytes
/
testextract.prg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
*PUBLIC loExcel && to keep it from being destroyed and closing the cursors
LOCAL lcFile, loText
lcFile = GETFILE("xlsx", "Workbook", "Load", 0, "Select Workbook to load into Class")
IF !EMPTY(lcFile)
loExcel = NEWOBJECT("VFPxWorkbookXLSX", "VFPxWorkbookXLSX.prg")
lnBegSec = SECONDS()
? "Processing file: " + JUSTFNAME(lcFile)
lnWB = loExcel.OpenXlsxWorkbook(lcFile)
lnEndSec = SECONDS()
IF (lnEndSec - lnBegSec) > 120
? "Time to load: " + TRANSFORM((lnEndSec - lnBegSec)/60) + " minutes"
ELSE
? "Time to load: " + TRANSFORM(lnEndSec - lnBegSec) + " seconds"
ENDIF
lnBegSec = SECONDS()
loExcel.SaveWorkbookAs(lnWB, ADDBS(JUSTPATH(lcFile))+JUSTSTEM(lcFile)+"2.xlsx")
lnEndSec = SECONDS()
IF (lnEndSec - lnBegSec) > 120
? "Time to save: " + TRANSFORM((lnEndSec - lnBegSec)/60) + " minutes"
ELSE
? "Time to save: " + TRANSFORM(lnEndSec - lnBegSec) + " seconds"
ENDIF
ENDIF