This example displays the number of recordsets in the Nwindex.mdb database and then enters their names on Sheet1.
To create the Nwindex.mdb database, run the Microsoft Excel example for the CreateDatabase method.
Dim db As Database, i As Integer
Sheets("Sheet1").Activate
Set db = Workspaces(0).OpenDatabase(Application _
.DefaultFilePath & "\NWINDEX.MDB")
With Sheets("Sheet1")
.Cells(1, 1).Value = "TableDef list for " & db.Name
.Cells(1, 1).EntireColumn.AutoFit
For i = 0 To db.TableDefs.Count - 1
.Cells(i + 2, 1).Value = db.TableDefs(i).Name
Next I
End With
MsgBox "There are " & db.TableDefs.Count & " TableDefs"
db.Close