Supportnet / Forum / Tabellenkalkulation
Unload me funktioniert nicht !
Frage
Hallo,
wenn nicht versuche Userform zu schließen, ist das Userform weg
aber ich in dem Dokument nicht schreiben bzw. Makro button ist deaktiv.
Ich vermute es liegt an diesem code : UserForm_Activate()
Könnt ihr mir weiterhelfen?
Danke
Gruß, Sara
Hier mein Code:
Private Sub CommandButton8_Click()
If MsgBox("Beenden ? Ja, oder nein", vbYesNo) = vbYes Then
Unload Me
Else
MsgBox ("Okay, dann nicht")
End If
End Sub
Private Sub UserForm_Initialize()
TextBox1.Value = Application.UserName
End Sub
Private Sub TextBox2_Change()
TextBox2.Value = Time
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox3.Value = Format(Now, "dddd, dd.mm.yyyy")
End Sub
Private Sub UserForm_Activate()
Do
DoEvents
TextBox2.Value = Time
Loop
End Sub
Antwort 1 von Teerbaby
Lass die Schleife in dem Activate weg. Verwende einen Timer um die Uhrzeit zu aktualisieren.
Antwort 2 von Sara12345
wie mache ich das ?
bin blond :-)
bin blond :-)
Antwort 3 von Teerbaby
Ein Timer-Control in das Form ziehen. Und dann im Tick-Ereignis die Zeit akualisieren. Intervall kannst du auf 1000 (=1 Sek.) stellen.
Antwort 4 von Teerbaby
Sorry, mein Fehler. Das gibts in VBA gar nicht.
Aber hoffe, das hilft dir http://forum.chip.de/basic/timer-vba-679536.html
Aber hoffe, das hilft dir http://forum.chip.de/basic/timer-vba-679536.html

