Hi Greg,
Thank you for your reply.
I replaced the "thisform.WorkBook" in your sample code with the value of lnWB (handle to the workbook).
Then I call GetSheetRowValues() to get the row values.
Question: do these values go into a cursor that I can read/browse? I tried the cursor named "xl_cells" (that you suggested) but it does not exist.
And even after the code gets a row value, do you have to manually populate it? Or is there a cursor that get filled?
TIA
>Hello--
>
>Glad you are trying to use the class -- hopefully it will work for you needs. The class reads an XLSX file and loads the rows/cells into a cursor xl_cells (and others as well) as the main cursor that contains the sheet data. This table is documented in the documentation at the end.
>
>The basic steps are as follows (assuming you have the file name and have an instance of the class named loExcel); the below example only returns the first row in the sheet, just iterate over all rows to get all cell values.
>
>
>lnWB = loExcel.OpenXlsxWorkbook(lcFileName, .F.)
>IF lnWB > 0
> loRow = loExcel.GetSheetRowValues(thisform.Workbook, 1, 1)
> IF ISNULL(loRow)
>
> ELSE
> FOR lnCol=1 TO loRow.Count
> IF !ISNULL(loRow.Values[lnCol, 1]) .AND. !EMPTY(loRow.Values[lnCol, 1])
>
> ENDIF
> ENDFOR
> ENDIF
>ELSE
>
>ENDIF
>
"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