ExcelApplication.Open* vs. ExcelTemplate
* ExcelApplication.Open is not available in
ExcelWriterSE, ExcelWriterLE, and ExcelWriterFree. |
 |
ExcelWriter provides two means of using a preset spreadsheet format to
generate a new spreadsheet:
Using ExcelApplication.Open is slower than using ExcelTemplate because the
ExcelApplication object is larger and more complex than the ExcelTemplate object.
However, the ExcelApplication object is rich in features, and can modify
spreadsheets at run time, while ExcelTemplate can only fill in cell values.
The following table summarizes the differences between the two.
Note: You can use ExcelTemplate and ExcelApplication
together, as demonstrated in the sample
Using ExcelTemplate with ExcelApplication.
| | ExcelApp.Open | ExcelTemplate |
| Supported Excel formats |
BIFF7 (Excel 95) and BIFF8 (Excel 97/2000/XP).
Note: If you open a BIFF7 (Excel 95) format spreadsheet,
you cannot apply BIFF8 features to it. ExcelWriter will save the spreadsheet
in BIFF7 format. |
BIFF8 only. ExcelTemplate does not support BIFF7 format templates, and
will not generate BIFF7 format files. |
| Available in ExcelWriterSE/LE/Free |
No. |
Yes. |
| Modifications at run time |
Yes. |
No. |
| Can bind to
data markers |
No. |
Yes. |
| Performance |
ExcelApplication's large object model makes it a slower
means of modifying an existing file than ExcelTemplate. |
Because it is compact, ExcelTemplate is a faster
means of populating a new spreadsheet with data from a
preformatted file than ExcelApp.Open. |
| Flexibility |
ExcelApplication is rich in features (including
database import)
which can be applied to an existing spreadsheet at run time. |
ExcelTemplate only inserts cell values (recordsets, variables, and arrays). |
| Data Sources |
ADO recordset (see
GetDataFromRecordset),
Excel spreadsheet (see
GetDataFromExcelSheet) and
two dimensional array(see Range.Value). |
ADO recordset, Variables, and Arrays (see Datasource). |
| Requires modification of an existing Excel spreadsheet before opening. |
No. |
Yes. To use an existing Excel spreadsheet as a template, you must
add data markers
to it. |
| Supports Macros and VBA |
ExcelApplication preserves existing Macros and VBA
but cannot create new Macros and VBA. |
ExcelTemplate preserves existing Macros and VBA
but cannot create new Macros and VBA. |
Copyright © 2003, SoftArtisans, Inc.