Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Greg Green XLSXWorkBookVFPX for extracting from Ex
Message
 
 
To
30/11/2018 14:09:55
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01663900
Message ID:
01663945
Views:
34
Again, thank you.

Looping through xl_cells is exactly what I was trying to do. But the test code never has this cursor open/exist.

Should this cursor be open right after this line?
lnWB = loExcel.OpenXlsxWorkbook(lcFileName, .F.) 
It is not in my test code.


>
>One point - the cursors are destroyed when the instance of the workbook class is closed. The method GetSheetRowValues() just returns a row object (from docs):
>
>Return object:
>loRow.Count Number of columns returned in row
>loRow.Values[nCol, 1] Cell value set to data type of the cell
>loRow.Values[nCol, 2] Cell data type
>A NULL value for a column indicates a value is not set. If a failure occurs (sheet or column does not exist, then a NULL is returned).
>
>Since it is not known what the columns are in terms of a field for a table, I did not try to code that method into the class. You as the developer would have to decide what the table fields are and the data types for your table. XLSX actually has a limited support of data types - date, datetime, string, and numeric (it really does not distinguish between numeric types) and most of this is based on the format assignment to the cell. So you have to decide what to do with the cell values and how to store into your table. The class determines the cell data type and returns that info to you in addition to the value.
>
>You can loop through the xl_cells cursor -- the keys are workbook, sheet, col, row. The cell value is contained in the field cellvalue as a string; however, if it is a string in the cell, it is stored into the xl_strings cursor and the cellvalue field contains the key value for the xl_string row. The data type of the cell value is stored in the field datatype (standard return values for VARTYPE() function). I have an include file that has the DEFINES.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform