forked from ggreen86/XLSX-Workbook-Class
-
Notifications
You must be signed in to change notification settings - Fork 1
/
excelxlsxtest.prg
31 lines (28 loc) · 1.07 KB
/
excelxlsxtest.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
25
26
27
28
29
30
31
*PUBLIC loExcel && to keep it from being destroyed and closing the cursors
LOCAL lnTime, lnWb, lnSh, lnRow, lnCol
loExcel = NEWOBJECT("VFPxWorkbookXLSX", "VFPxWorkbookXLSX.prg")
loExcel.Demo()
*loExcel.DeleteAllWorkbooks()
*loExcel.SaveTableToWorkbook(HOME(2) + "Data\customer", "DemoCustomer.xlsx", .T., .T.)
*loExcel.SaveTableToWorkbook(HOME(2) + "Data\employee", "DemoEmployee.xlsx", .T., .T.)
*loExcel.SaveTableToWorkbook(HOME(2) + "Data\products", "DemoProducts.xlsx", .T., .T.)
*loExcel.DeleteAllWorkbooks()
*SET DEBUGOUT TO "TimeTest.txt"
*lnWb = loExcel.CreateWorkbook("TimeTest1.xlsx")
*IF lnWb > 0
* DEBUGOUT "Writing First Time Test Workbook"
* lnSh = loExcel.AddSheet(lnWb, "Test Sheet 1")
* lnTime = SECONDS()
* FOR lnRow=1 TO 10000
* FOR lnCol=1 TO 5
* loExcel.SetCellValue(lnWb, lnSh, lnRow, lnCol, SYS(2015))
* ENDFOR
* FOR lnCol=6 TO 10
* loExcel.SetCellValue(lnWb, lnSh, lnRow, lnCol, lnRow*lnCol)
* ENDFOR
* ENDFOR
* DEBUGOUT "SetCellValue:", SECONDS()-lnTime
* loExcel.SaveWorkbook(lnWb)
* DEBUGOUT "SaveWorkbook:", SECONDS()-lnTime
*ENDIF
*SET DEBUGOUT TO