Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) '************************************************************************* 'The Sleep API call is used to ensure you don't prevent user input forever '************************************************************************* Public Sub BlockUserInput(lTime As Long) 'Block mouse and keyboard input BlockInput True 'Wait seconds before allowing input Sleep lTime 'Unblock mouse and keyboard input BlockInput False End Sub