Put the following in a public module. Should work for what you need (Usage - TimedMsgBox "Your prompt", timeout time in sec, optional style, optional title)
Code:
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, LParam As Any) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Private Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Private strMBTitle As String
Public Function TimedMsgBox(strPrompt As String, Optional ByVal lngTimeOut As Long = 0, Optional Icon As VbMsgBoxStyle = vbOKOnly, Optional strTitle As String = vbNullString)
Dim lngTimerId As Long
strMBTitle = strTitle
If lngTimeOut = 0 Then
lngTimeOut = 5 * 1000
Else
lngTimeOut = lngTimeOut * 1000
End If
lngTimerId = SetTimer(0, 0, lngTimeOut, AddressOf TimeOutMB)
TimedMsgBox = MsgBox(strPrompt, Icon, strMBTitle)
TimedMsgBox = 0
KillTimer 0, lngTimerId
End Function
Private Sub TimeOutMB(lngHWnd As Long, lngMsg As Long, lngIdEvent As Long, lngTime As Long)
SendMessage FindWindow(vbNullString, strMBTitle), 16, 0&, 0&
End Sub