Option Compare Database
'==========================================
' Import Data From Excel With DoCmd
'==========================================
Sub importDataFromExcelDoCmd()
' Set variables
Dim strTableName As String
Dim strFileName As String
Dim blnHasHeadings As Boolean
' Set data
strTableName = "tblCustomers"
strFileName = "F:\VBAmacros\Access\MOCK_DATA.xlsx"
blnHasHeadings = True
' Import data
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, strTableName, strFileName, blnHasHeadings
End Sub