CommandType Property

CommandType Property

         Example         Applies To

Returns or sets one of the XlCmdType constants listed in the following table. The constant that is returned or set describes the value of the CommandText property. The default value is xlCmdSQL. Read/write XlCmdType.

Constant Description
xlCmdCube Contains a cube name for an OLAP data source.
xlCmdDefault Contains command text that the OLE DB provider understands.
xlCmdSQL Contains an SQL statement.
xlCmdTable Contains a table name for accessing OLE DB data sources.

Remarks

You can set the CommandType property only if the value of the QueryType property for the query table or PivotTable cache is xlOLEDBQuery.

If the value of the CommandType property is xlCmdCube, you cannot change this value if there is a PivotTable report associated with the query table.