Linker IT Software
Order Home
menubar-top-links menubar-top-rechts

SQL*XL: Database to Excel bridge

Related LIT software: litLIB: Excel power functions pack encOffice: Protect your Excel file easy and safe

Home Products SQL*XL Help VBA SQLXL Targets Target

Buy now

Download now

SQL*XL online help


SQL*XL API: TargetPivotTable Object

TargetPivotTable Object


Class clsTargetExcel is a subclass of:



The TargetPivotTable object implements the functionality to output data from SQL*XL to a pivot table in MS Excel. The properties of TargetPivotTable determine the way data is output to Excel. To obtain a reference to the targetPivotTable object use the Targets property of the SQLXL object. Example: SQLXL.Targets( litPivotTable ).PivotTableLocation = "D12"

Physically, output is generated by the Statement objects notably the StmtDQL object that implements select statements. The execute method of the Statement outputs the data according to the setting of the Target property on the Statement. If Statement.Target = litPivotTable then output will be generated in a pivot table in Excel.


Name Data Type Description
PivotTableLocation As String The address of the cell where the pivot table should be created in the spreadsheet.



Set the cell A5 the starting point where pivot table should be created in the spreadsheet:

SQLXL.SQL.setText Text :=  "select * from emp" 
Set SQLSL.SQL.Statements(1).Target = Targets(litPivotTable)
Targets(litPivotTable).PivotTableLocation = "A5" SQLXL.SQL.Statements(1).Execute
Note: Please record all code through the macro recorder.

SQL*XL ribbon in Excel