Sorry, I still get same error due to For Each line below.
Dim db As DAO.Database Set db = DBEngine(0).OpenDatabase(F1) 'db.Close If TblExists(ActiveSheet.Name) Then DoCmd.DeleteObject acTable, ActiveSheet.Name End If
Public Function TblExists(ByVal strTableName As String) As Boolean
Dim tblN As Object
TblExists = False
For Each tblN In db.TableDefs
If tblN.Name = strTableName Then
TblExists = True
Exit For
End If
Next tblN
End Function