Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Greg Green XLSXWorkBookVFPX for extracting from Ex
Message
From
30/11/2018 12:27:17
 
 
To
30/11/2018 08:56:02
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01663900
Message ID:
01663926
Views:
74
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.)      && this opens the Excel file and reads into the internal cursors; lnWB is the handle to the new workbook
IF lnWB > 0
	loRow = loExcel.GetSheetRowValues(thisform.Workbook, 1, 1)    && See documentation -- this returns the cell values for first row with datatype
	IF ISNULL(loRow)
		&& failure
	ELSE
		FOR lnCol=1 TO loRow.Count
			IF !ISNULL(loRow.Values[lnCol, 1]) .AND. !EMPTY(loRow.Values[lnCol, 1])
				&& Got a cell value
			ENDIF
		ENDFOR
	ENDIF
ELSE
  && Failure
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform