TBIExcel class provides import and export capabilities for Microsoft Excel files, supporting both legacy (.xls) and modern (.xlsx) formats.
Quick Start
Requirements
Excel import requires Microsoft Excel to be installed on the system (Windows only). Check if Excel is available:Key Methods
ImportFile
Import an Excel workbook:Import from Folder
Configuration Options
WorkSheet
Import specific worksheet by name:Range
Import specific cell range:HeaderCount
Number of header rows to parse:Advanced Examples
Import Specific Sheet and Range
Import with Progress
Import Multiple Workbooks
DataDefinition Import
Export to Excel
UseTBIExcelExport to save data to Excel format:
Export Options
- One worksheet per table in TDataItem
- Headers in first row
- Automatic column width
- Data types preserved
Export with Custom Engine
File Format Support
.xls- Excel 97-2003.xlsx- Excel 2007 and later
Common Patterns
Import from File Dialog
Handle Multiple Sheets
Import Named Range
Performance Considerations
- Large Files: Excel import can be slow for files with 100,000+ rows
- Memory: Each worksheet is loaded into memory completely
- COM Objects: Excel is accessed via COM automation which adds overhead
- Close other Excel instances before import
- Use Range to limit imported cells
- Consider converting large Excel files to CSV first
Common Issues
Excel not installed error
Excel not installed error
Check if Excel is available before import:
File locked by another process
File locked by another process
Close the Excel file before importing:
Wrong data types detected
Wrong data types detected
Excel import uses CSV parser internally. Check HeaderCount and delimiter:
Import is very slow
Import is very slow
Limit the range or worksheet:
Temporary files (~$) showing up
Temporary files (~$) showing up
Exclude them:
