Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel XLS/XLSX to CSV
Message
From
17/05/2016 09:28:58
 
 
To
17/05/2016 09:23:32
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01636368
Message ID:
01636496
Views:
64
>There is not a specific method to do this. There are methods to retrieve the row and column counts. There is a method to retrieve the cell value and data type. Start two FOR-ENDFOR loops and then read each cell and write to your output. If 'clsXLSXReader' is the name of the class, lnWB is the workbook number as loaded, and lnSh is the sheet number to read, then something like:
>
>
>FOR lnRow=1 TO thisform.clsXLSXReader.GetLastRowNumber()
>  FOR lnCol=1 TO thisform.clsXLSXReader.GetMaxColumnNumber()
>     lcCellValue = TRANSFORM(NVL(thisform.clsXLSXReader.GetCellValue(lnWB, lnSh, lnRow, lnCol), ""))
>     && now write the cell value...
>  ENDFOR
>ENDFOR
>
>
>I used the NVL() function to not write a NULL value if a cell is not populated, but instead an empty value.

OK, do I understand that your class would be used to read the file and then VFP code to write the cell contents into a new file in whatever format (e.g. CSV) ?

.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform