Private Sub CommandButton1_Click()
Marche
End Sub
Sub Marche()
Static test As Boolean
Dim t#
test = CommandButton1.Caption = "Marche"
CommandButton1.Caption = IIf(test, "Arrêt", "Marche")
CommandButton1.BackColor = IIf(test, vbGreen, vbRed)
CommandButton1.ForeColor = IIf(test, vbBlack, vbWhite)
While test
t = Timer + 0.1: If t > 86400 Then t = 0
While Timer < t: DoEvents: Wend
If ActiveWindow.Zoom < 100 * [D3] Then ActiveWindow.Zoom = 100 * [D3]
If ActiveWindow.Zoom > 100 * [D4] Then ActiveWindow.Zoom = 100 * [D4]
Wend
End Sub