Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Anzeige
Inhaltsverzeichnis

Prüfung ob Objectvariable gesetzt ist.

Forumthread: Prüfung ob Objectvariable gesetzt ist.

Prüfung ob Objectvariable gesetzt ist.
31.08.2005 16:59:58
Stephan
Entschuldigt die dumme grundsätzliche Frage. Wie prüft man in VBA ob eine Objektvariable auf ein Objekt zeigt. "isEmpty", "isNull" etc. scheinen nicht zu funktionieren ebenso der vergleich mit Nothing. Siehe unten
Stephan
+++++
Dim obj Project as clsProject
...
...
if objProject nothing then
...
end if
Anzeige

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
if Not objProject Is Nothing then
31.08.2005 17:01:17
Fred
f
AW: if Not objProject Is Nothing then
31.08.2005 17:03:02
Stephan
Arg! ich wußte es !!!
schönen Dank
AW: Prüfung ob Objectvariable gesetzt ist.
31.08.2005 17:06:38
Thomas
Hallo Stephan,
hier zwei Ansätze ...


Option Explicit
Sub AddComment()
    Dim shp As Excel.Shape
    Set shp = ActiveCell.AddComment.Shape
    If Not shp Is Nothing Then _
        MsgBox "Existiert"
    If ObjPtr(shp) Then _
        MsgBox "Existiert"
End Sub
Gruss
Thomas
Risi Thomas Softwareentwicklung
Addins - Datenbanklösungen - Komponenten - RTDServer

Anzeige
AW: Prüfung ob Objectvariable gesetzt ist.
02.09.2005 00:22:48
Stephan
Deine Antwort habe ich heute erst bemerkt.
Vielen Dank auch dir für die zweite Möglichkeit.
Gruss
Stephan
Anzeige
Anzeige
Live-Forum - Die aktuellen Beiträge
Datum
Titel
14.05.2026 13:31:09
14.05.2026 09:50:42
13.05.2026 19:14:18