Object Reference


The following reference provides an overview of the new objects from the Excel 2003 object library.

 

ListColumn

Excel 2003

ListColumns (..)

 

. DataFormat ˜ ListDataFormat

   

.Range ˜ Range

   

.XPath ˜ XPath

This object describes a column in a list. With the property TotalsCalculation one can specify the function with which the result field of the column should be calculated (e.g., xltotalsCalculationSum ). Range refers to the range of cells that is filled by the ListColumn .

When the data in the list come from an XML data source, the XPath object creates the connection to the XML data and specifies which XML element was imported or is to be exported later.

 

ListColumns

Excel 2003

ListObject .ListColumns

 

( index or name ) ˜ ListColumn

This enumeration refers to the columns of a list. With Add a new column can be inserted at a specified position.

 

ListDataFormat

Excel 2003

ListColumn .DataFormat

   

This object describes the formatting properties of a column of a list. These properties are "read only" and cannot be changed. Alas, the documentation of Office 2003 Beta 2 provides no insight into where these properties come from. In my tests, all the properties of ListDataFormat were generally unfilled, regardless of the data source underlying the list.

 

ListObject

Excel 2003

ListObjects (..)

 

.ListColumns(n) ˜ ListColumn

Range .ListObject

 

.ListRow(n) ˜ ListRow

QueryTable .ListObject

 

.Range, .TotalsRowRange ˜ Range

   

.XmlMap ˜ XmlMap

This object describes a list in an Excel table. A list here is a range of cells with tabular data, which in Excel 2003 can be conveniently processed . New lists can be generated with Workbook .ListObjects.Add , where an existing range of cells, an XML file, or an external database can serve as the data basis.

The size of a list can be changed with resize . ShowTotals specifies whether result cells should be displayed below the list. Unlist eliminates the list structure. (All the data are preserved.)

 

ListObjects

Excel 2003

Worksheet .ListObjects

 

(index or name) ˜ ListObject

This enumeration refers to the lists of a worksheet.

 

ListRow

Excel 2003

ListRows

 

(..) .Range ˜ Range

This object describes a row in a list.

 

ListRows

Excel 2003

ListObject

 

.ListRows (index or name) ˜ ListRow

This enumeration refers to the rows of a list. With Add a new row can be inserted at a specified position.

 

XmlDataBinding

Excel 2003

XmlMap. DataBinding

   

This object describes the data origin of XML data. The only relevant property is SourceUrl , which contains a character string of the data source (thus, for example, a file name or an Internet address). With the method Refresh the data are read in again.

 

XmlMap

Excel 2003

ListObject .XmlMap

 

.DataBinding ˜ XmlDatabinding

Workbook. XmlMaps(n)

 

.RootElementNamespace ˜ XmlNamespace

XPath .Map

 

.Schemas(n) ˜ XmlSchema

This object describes the common properties (schema, name space) and import/export options of an XML data source. The object serves as a linkage between the XML data (objects XmlDatabinding , XmlSchema , XmlNamespace ) and the cells of a worksheet into which the data are to be imported (object XPath ).

With the method Import the data importation is carried out, where the data source must be given as a parameter (XML file name or Internet address). This is necessary because with an XmlMap object a number of XML files can be imported, for example, to concatenate data. ImportXml functions analogously, reading the data, however, from an XML character string passed as parameter.

To the extent that Excel is capable of saving the data (property IsExportable ), this process can be carried out with the method Export or ExportXml . The method Delete deletes the XmlMap object.

 

XmlMaps

Excel 2003

Workbook .XmlMaps

 

(index or name) ˜ XmlMap

This enumeration refers to all XmlMap objects of an Excel file. Such objects are generated automatically during an XML importation process (for example, Active- Workbook.XmlImport ). You can explicitly add a new XmlMap object with Add . For this you must pass the XML schema as parameter, an XML character string, a file name, or an Internet address.

 

XmlNamespace

Excel 2003

Workbook .XmlNamespaces(n)

   

XmlMap .RootElementNamespace

   

XmlSchema .NameSpace

   

This object defines a prefix, which is a character string that can be prefixed to the names of XML elements. Prefixes make it possible to distinguish among various like-named XML elements (for example, <prefix1:name> and <prefix2:name> ). All XML elements with a particular prefix are called collectively a name space .

This object has only two relevant properties: Prefix contains the prefix character string, and Uri , the address of the definition of the name space. (URI stands for uniform resource identifier . The Uri character string looks like a file name or Internet address.)

 

XmlNamespaces

Excel 2003

Workbook .XmlNamespaces

 

(index) ˜ XmlNamespace

This enumeration refers to all XmlNamespace objects of an Excel file.

 

XmlSchema

Excel 2003

XmlSchema (..)

 

.Namespace ˜ XmlNamespace

This object describes the structure of XML data. This description takes place in XML and is contained as a character string in the property XML . Optionally, additional information can be added to the schema via the name space; this information resides in its own object ( XmlNamespace ).

 

XmlSchemas

Excel 2003

XmlMap .Schemas

 

(index) ˜ XmlSchema

This enumeration refers to all schemas of an XmlMap object. (In many cases, there is only one schema for each XmlMap object. If there are several schemas, then Schemas(1) refers to the primary schema for the root element.)

 

XPath

Excel 2003

ListColumn .XPath

 

.Map ˜ XmlMap

Range. XPath

   

This object associates individual elements of an XML data stream ( XmlMap ) with a range of cells or column of a list. Which XML elements are to be imported is determined by an XPath search expression, which is passed to the method SetValue . The actual importation takes place only when the Import method is executed for the underlying XmlMap object.

The properties Value (for the XPath search expression), Map , and Repeating of XPath contain the parameter passed to SetValue . These properties can only be read. Changes must be carried out with SetValue .

To remove the association between a Range or ListColumn object and XML data the method Clear must be executed for the affected XPath object.




Definitive Guide to Excel VBA
Linux Application Development For The Enterprise (Charles River Media Programming)
ISBN: 1584502533
EAN: 2147483647
Year: 2002
Pages: 134

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net