Sub ImportSheetToAccess()
Application.ScreenUpdating = False
If Dir("C:\My Documents\...\master.ldb") = "" Then
Dim axs As Object
Set axs = CreateObject("Access.Application")
With axs
.OpenCurrentDatabase "C:\My Documents\...\master.mdb", True
.DoCmd.TransferSpreadsheet acImport, , "order_placement_data", "C:\My Documents\...\Master_Data.xls", True
.CloseCurrentDatabase
End With
Else
MsgBox ("Database file is locked. "), vbCritical
Exit Sub
End If
ExitProc:
Set axs = Nothing
Application.ScreenUpdating = True
End Sub