Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ImportFromXlsx 1.3

Status
Not open for further replies.

vgulielmus

Programmer
Jan 27, 2014
522
RO
Just finished a new version of ImportFromXlsx
In version 1.3 I've added a new (fifth) parameter. Very useful for worksheets with gaps (empty cells), but the process is slower.
If the fifth parameter, llEmptyCells, is passed as .T., then column position and data type is checked for each cell (much slower)

Please download from ImportFromXlsx 1.3
Direct link
ImportFromXlsx 1.3

General description
Import data from an Excel 2007+ workbook (xlsx). Excel presence is not required.
- return the name of the generated DBF / cursor; the same name with de xlsx / SYS(2015); empty string on error
- By default, analyze the first (imported) row of the xlsx table and get the number of columns and data types from this row
If the fifth parameter, llEmptyCells is passed as .T., then column position and data type is checked for each cell (much slower)
- creates a DBF / cursor (according to the fourth parameter)
- and populate this DBF with data from the xlsx
- the field are named mField1,mField2 and so on
- the size and precision of the numeric field is calculated with MAX(LEN(ALLTRIM(cell value))), respectively with MAX(LEN(ALLTRIM(cell value))-AT(decimal separator,ALLTRIM(cell value))
- the length of character fields is MAX(LEN(cell value))
- if MAX(LEN(cell value)) > 254 and contains at least one CHR(13), the field is MEMO

Miscelaneous
- By default is imported the first sheet, no matter which name has
- Sheet can be passed by name (string), or by position (number)
- Files can be extracted with winrar

Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
Thanks Vilhelm, will check it out.


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Great news, thank you !

Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top