Application.EnableEvents geht nicht
13.03.2008 11:05:51
dirk
Habe folgendes kleines Macro geschrieben, um eine Klick-event zu verarbeiten.
Private Sub CheckBox20_Click()
lcell = ActiveSheet.OLEObjects("CheckBox20").LinkedCell
Range(lcell).Select
ActiveCell.Offset(0, -14).Select
If ActiveCell.Value = "Other reason (Please specify here)" Then
If Range(lcell).Value = "True" Then
OReason = InputBox("Please describe the other reason(s) for non compliance.", "Non- _
compliance reasons", "Other reason (Please specify here)")
If OReason = "" Then
Application.EnableEvents = False
Range(lcell).Value = "False"
Application.EnableEvents = True
End If
ActiveCell.Value = OReason
End If
Else
MsgBox ("The entry will be reset")
ActiveCell.Value = "Other reason (Please specify here)"
End If
MsgBox "Finished"
End Sub
Leider funktioniert das Abschalten der Application.EventsEnable nicht, d.h. sobald das Macro den Zellinhalt der Linkedcell (LCell) auf False setzt, started der Event das Macro nochmal.
Vieleicht weiss jemand wo der Fehler liegt oder ob der event fuer thissheet abgeschaltet werden kann.
Danke im Voraus
Dirk