04 OpenXML - AndrewMB2/Logic-Architect-for-Excel-VBA GitHub Wiki

OpenXML method

Creates a TableData, ArrData or RsetData object from a XML file in PersistXML format. Returns True if successful, otherwise False.

Applies to

TableData ArrData RsetData Xdata XShared

TableData

Parameters

Name Type Description
FileName Variant Name/path of the file/object containing this data.
TableStart Range (optional) The start position on the worksheet where the header row will be placed.
VariableWidth Boolean (optional) Indicates that the number of fields may vary from one call to the next.

Creates a TableData object and populates it with the data from a XML file. If the TableData object has not already been initialised, TableStart must be supplied and the headers and data will be placed on the worksheet. If a table is required, then an empty table with one column should be placed on the worksheet first with it's header at TableStart.

Alternatively the TableData object may already have been initialised. In this case, any existing data is cleared first. If VariableWidth is false, the columns on Xd must match the corresponding columns starting from the first (subsequent table columns/formulae are retained). If VariableWidth is True, it resizes the data to the width of the new output and clears surplus headings and table columns.

ArrData

Parameters

Name Type Description
FileName Variant Name/path of the file/object containing this data.

Creates an ArrData object and populates it with the data from a XML file. RsetData must also be present.

RsetData

Parameters

Name Type Description
FileName Variant Name/path of the file/object containing this data.

Creates a RsetData object and populates it with the data from a XML file. The record set is opened forward only.