Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Declare PtrSafe Function Beep Lib "kernel32.dll" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Dim shape As shape Set shape = ActiveSheet.Shapes("MsgInfo") shape.Visible = msoTrue Call Sleep(1000) 'Attente 1 seconde Call Beep(800, 500) ' Beep pendant 500ms shape.Visible = msoFalse
Dim shape As shape Set shape = ActiveSheet.Shapes("MsgInfo") shape.Visible = msoTrue Application.OnTime Now + TimeValue("00:00:01"), "WaitEnd"
Public Sub WaitEnd() Dim shape As shape Set shape = ActiveSheet.Shapes("MsgInfo") VBA.Beep shape.Visible = msoFalse End Sub
Public Sub WaitEnd() Dim ctrl As OLEObject Set ctrl = ActiveSheet.OLEObjects("MsgInfo1") VBA.Beep ctrl.Visible = False End Sub
Dim ctrl As OLEObject Set ctrl = ActiveSheet.OLEObjects("MsgInfo1") ctrl.Visible = True Application.OnTime Now + TimeValue("00:00:01"), "WaitEnd"
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question