Dim lngColumn As Long
Dim xlx As Object, xlw As Object, xls As Object, xlc As Object
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim blnEXCEL As Boolean
blnEXCEL = False
On Error Resume Next
Set xlx = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Set xlx = CreateObject("Excel.Application")
blnEXCEL = True
End If
Err.Clear
On Error GoTo 0
xlx.Visible = True
Set xlw = xlx.Workbooks.Open(CurrentProject.Path & "\exceldokuman.xlsx", , True)
Set xls = xlw.Worksheets("Sayfa1")
Set xlc = xls.Range("A2")
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("tbl_tablo1", dbOpenDynaset, dbAppendOnly)
On Error Resume Next
Do While xlc.Value <> ""
rst.AddNew
For lngColumn = 0 To rst.Fields.Count
rst.Fields(lngColumn).Value = xlc.Offset(0, lngColumn).Value
Next lngColumn
rst.Update
Set xlc = xlc.Offset(1, 0)
Loop
rst.Close
Set rst = Nothing
dbs.Close
Set dbs = Nothing
Set xlc = Nothing
Set xls = Nothing
xlw.Close False
Set xlw = Nothing
If blnEXCEL = True Then xlx.Quit
Set xlx = Nothing
Üstteki kod, Access uygulamanızla aynı dizindeki exceldokuman.xlsx isimli Excel belgesinin Sayfa1 sayfasındaki verileri, tbl_tablo1 isimli tabloya aktarır.