I'm wondering if anyone can see anything wrong with this code:

  If Application.Wait(Now + TimeValue("0:02:45")) Then
    MsgBox "Time expired"
    End If
    
    newHour = Hour(Now())
    newMinute = Minute(Now()) + 3
    newSecond = Second(Now()) + 1
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime
Or, this code:
Function RunAppendQuery(strDatabaseName As String, strAppendQueryName As String)
    Dim db As DAO.Database
    Dim qdf As DAO.QueryDef
    Set db = OpenDatabase(strDatabaseName)
    Set qdf = db.QueryDefs(strAppendQueryName)
    qdf.Execute
    qdf.Close
    Set qdf = Nothing
End Function
*im no longer using the DAO object libraries because it would not recognize the DB until i activated the "Microsoft 12.0 Access database engine object." Do i need to change the

Dim db As DAO.Database
    Dim qdf As DAO.QueryDef
to reflect that? yes, im new to VBA.

I don't get an error from either of them, but my macro seems to just lock up Excel. The 2nd set of code is actually run before the first. im trying to run an append query in access, wait 3 minutes 1 second, then run the rest of the macro. it seemed to work ok last week, but of course come Monday it doesn't.