Set Obj as Class - Check to see if Class is active

I am creating a Class Module and I need to determine if the Class is currently active.  what is the proper syntax to determine this?  My Current attempt does not like the ".ISOpen"

Public Function ISCenter_Data_Load_Routine(Optional ByVal ReportName As String, _
                                            Optional ByVal MODName As String, _
                                            Optional ByVal recct As Long, _
                                            Optional ByVal ProcName As String, _
                                            Optional ByVal sErr As String) As Boolean

Dim objLog As New clsISCenterEventLogger
   On Error GoTo ISCenter_Data_Load_Routine_Error

    With objLog
        If .IsOpen = True Then
            objLog.OpenLogRecord ReportName:=ReportName, _
                                MODName:=MODName, _
            objLog.CloseLogRecord RowsAffected:=recct, _
                                    ErrMsg:=sErr, _
                                    AdditionalInfo:="Tested using VBA class", _
        End If
    End With
   On Error GoTo 0
   Exit Function


    MsgBox "Error " & Err.Number & " (" & Err.Description & _
        ") in procedure ISCenter_Data_Load_Routine of Module basEventLogger"

End Function

Open in new window

Here is my latest attempt to set the value:

Option Compare Database
Option Explicit

Private mIsOpen As Boolean
Property Get IsOpen() As Boolean
    mIsOpen = True
    IsOpen = mIsOpen
End Property

Open in new window

Karen SchaeferAsked:
Who is Participating?
Jeffrey CoachmanConnect With a Mentor MIS LiasonCommented:
So all is well than?

As I stated, there are many simple "IsOpen" functions available. (less than 5 lines of code)
Just FYI...

Jeffrey CoachmanMIS LiasonCommented:
What is this "Class" doing?

Is it just used to detect if a particular object is open?

If so, there are simpler ways to do this besides creating a class...
Karen SchaeferAuthor Commented:
Is it just used to detect if a particular object is open?


I need to indicate which part of the function should be used depending on which object is open?

here is what I am using found solution elsewhere:

Property Get IsOpen() As Boolean
    IsOpen = IIf(EventID = 0, False, True)
End Property


Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Karen SchaeferAuthor Commented:
Thanks for the assistance
Karen SchaeferAuthor Commented:
thanks as always.
Jeffrey CoachmanMIS LiasonCommented:
Then if your own post solved the issue , then that is what you should have accepted (not my post)


Karen SchaeferAuthor Commented:
I wanted to give you the points for your time.
Jeffrey CoachmanMIS LiasonCommented:

How long have we been working together?

If you answer your own post, then accept your own answer.

Not knowing the full scope of your app or the function, ...My post was just to let you know that there are other ways to detect if an object is open.

My issue with you accepting my post is four-fold
1.  You solved your own issue, you posted the solution, hence you should accept your own post.
2. My post really did not provide any info on the alternate methods, so I will post the popular link here:
3. Other members may be encouraged to see that existing member are so uplifted by the help they get on EE that they get to the point where they can solve there own issues.
4. Although I will fight for points I feel I deserve,  ...I honestly have enough of them.

So if you really want to thank me, just shoot me an email, ...and give yourself some much deserved credit.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.