Skip to content

cDataTable.LoadArray

Brendon edited this page Mar 17, 2024 · 2 revisions

LoadArray

returns boolean

accepts (Variant array)

This is one of the most useful functions for getting Excel data into a cDataTable object A selection or range of cells in Excel can be passed as an array of values to the cDataTable object which is then added to the Dictionary Records of cRecords held in the cDataTable.

The top row of the array is always assumed to be the field headers, and is where the field names are generated from. The fields are loaded as [cField] objects and assembled into a cRecord which is then added to the cDataTables Record Dictionary object.

If the cDataTable is empty then the record structure for the [cDataTable] is defined by the record headers in the array. If there are already records in the cDataTable then the records in the array must have the same schema as the existing records or they will not be added.

See also: cDataTable.AddRecord, cRecord.AddField

Clone this wiki locally