OLEDBConnection.CommandType (Excel)

Returns or sets one of the XlCmdType constants. Possible return values are xlCmdCube - Contains a cube name for an OLAP data source, xlCmdDAX - Contains a Data Analysis Expressions (DAX) formula, xlCmdDefault - Contains command text that the OLE DB provider understands, xlCmdExcel - Contains an Excel formula, xlCmdList - Contains a pointer to list data, xlCmdSql - Contains an SQL statement, xlCmdTable - Contains a table name for accessing OLE DB data sources, xlCmdTableCollection - Contains the name of a table collection.

The constant that is returned or set describes the value of the CommandText property. The default value is xlCmdSQL.


ActiveWorkbook.Connections(1).OLEDBConnection.CommandType = xlCmdCube