![]() |
[Excel] OLEObject und die Ereignisse
Das OLEObject hat die zwei Ereignisse GotFocus und LostFocus.
Doch leider will es mit nicht gelingen die Ereignisse abzufangen. Da habe ich folgenden Test versucht: Kann mir jemand erkläaren warum es zu einem Laufzeitfehler kommt???
Code:
In VBA-Code in einer Excel-Tabelle.
Private withevents t As OLEObject
Private Sub cmdTest_Click() Set t = Tabelle1.OLEObjects("cmdTest") ' <- Fehler: Ohne WithEvents klappt es End Sub Private Sub cmdTest_LostFocus() MsgBox "test" End Sub Private Sub t_LostFocus() MsgBox "test 2" End Sub |
Re: [Excel] OLEObject und die Ereignisse
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:16 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz