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: TargetWord Object

TargetWord Object


Class clsTargetWord is a subclass of:



The TargetWord object implements the functionality to output data from SQL*XL to MS Word. The properties of TargetWord determine the way data is output to Word. To obtain a reference to the targetWord object use the Targets property of the SQLXL object. Example: SQLXL.Targets( litWord ).Headings = False

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 = litWord then output will be generated in Word.


Name Data Type Description
Headings As Boolean Print column headings
Transpose As Boolean When set to True causes Database rows to be placed in Table columns.
When set to False causes Database rows to be placed in Table rows.



Query a table and send the output into a MS Word document:

SQLXL.SQL.setText Text:= "select * from dept"
With SQLXL.Targets(litWord)
    .Headings = True
    .Transpose= False 
End With
With SQLXL.Statements(1)
    Set .Target = Targets( litWord )
End With

Note: Please record all code through the macro recorder.

SQL*XL ribbon in Excel