Hi -
I need to list an xls file's fields in a listbox 'List1'. The xls is selected from a filelistbox 'File2'.
This is the following code I am using but it keeps on telling me that the filename 'TEMP.XLS' could not be found, although I have checked that the path and filename is correct.
For n1 = 0 To (File2.ListCount - 1) 'Counts the number of xls files
If File2.Selected(n1) = True Then 'Checks if a xls has been selected
dbfsel = File2.List(n1) 'The selected xls
End If
Next
Set DBase = opendatabase ("D:\Erwin_files\My_Data\User_Request\Erwin\DEL_Multiple_fields\Table\TEMP.XLS", False, False, "EXCEL 8.0;")
THE FILE NOT FOUND MSG COMES UP WHEN THIS 'SET' STRING IS EXECUTED
Set rs = DBase.OpenRecordset(dbfsel) 'dbfsel is the selected xls
With rs
For n2 = 0 To rs.Fields.Count - 1
List1.AddItem rs.Fields(n2).Name
Next n2
End With
rs.Close
Thanx in advance
