The TargetExcel object implements the functionality to output data from SQL*XL to MS Excel. The properties of
TargetExcel determine the way data is output to Excel. To obtain a reference to the targetExcel object use the
Targets property of the SQLXL object. Example: SQLXL.Targets( litExcel ).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 = litExcel then output will be generated in Excel.
Properties:
Name
Data Type
Description
AutoFilter
As Boolean
Applies Excel's autofilter feature to the resultset after it is pasted into the spreadsheet. Note that only 1 range
of cells can have autofilter enabled per worksheet.
AutoFit
As Boolean
Resizes the columns to fit the data.
FormatData
As Boolean
Set to false if no formatting should be applied
by SQL*XL
Headings
As Boolean
Print column headings
Sort
As Boolean
When Transpose is set to False, Sort will sort the data according to the first column.
SQLInNote
As Boolean
Put a comment in the top left cell of the resultset range with the SQL that was executed.
StartFromCell
As String
The address of the cell where the data should be put into the spreadsheet. Note that the workbook containing the cell is expected
to be open.
Transpose
As Boolean
When set to True causes Database rows to be placed in Excel columns.
When set to False causes Database rows to be placed in Excel rows.
Example:
Set the cell A5 the starting point where data should be put into the spreadsheet:
SQLXL.SQL.setText Text := "select * from emp" Set SQLSL.SQL.Statements(1).Target = Targets(litExcel)< BR
>
Targets(litExcel).StartFromCell = "A5"
SQLXL.SQL.Statements(1).Execute
Note: Please record all code through the macro recorder.
Copyright (C) 1995-2007 Linker IT
Software BV. All Rights Reserved. Oracle is a registered trademark of
Oracle corporation. Excel and Office are registered trademarks of
Microsoft corporation. Other names appearing on the site may be trademarks
of their respective owners. Software,
files, documents, articles and other material are provided
"as is" and without warranties as to performance or mechantability or
any other warranties whether expressed or implied. No
warranty of fitness for a particular purpose is offered.
sitemap