Syntax
| SQL.ImportExcelFile(FileName, Array2D()[, Worksheet])
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Description
| Opens an .xls file and loads its contents into a two-dimensional array variable. All records are loaded into the array, with a maximum of 65536 rows.
When loading is successful, this function returns the value TRUE, or else FALSE.
The first dimension of the array contains the lines of the worksheet, the second dimension contains the individual columns. Array2D(0,0) contains the first column of the first row.
Note: Does not require an installed version of Micorosoft Excel.
Supports worksheets that are Excel-97 compatible (BIFF9 format).
| ||||||||
See Also
| |||||||||
Example
| Sub Main() Dim sFile As String Dim myCells() As Variant Dim x As Integer, y As Integer sFile = InputBox$("Excel file:") If SQL.ImportExcelFile(sFile, myCells()) = True Then For x = 0 To UBound(myCells) For y = 0 To UBound(myCells, 2) Debug.Print x & vbTab & y & vbTab & myCells(x, y) Next y Next x End If End Sub | ||||||||