i want to declare class globaly here is my example:
i want to use class clsIEError that looks exactly like this:
Option Explicit
Public Sub m(msg As String, Optional title As String = "Title:")
'Attribute Value.VB_UserMemId = 0
'this method will be used as defualt method
'and here are attributes msg and title used to create some inteface
End Sub
and this is how it works example1:
Sub CATMain()
Dim ie As clsIEError
Set ie = New clsIEError
ie "test", "title"
Set ie = Nothing
End Sub
but my problem is that i want to have it globally example2:
Option Explicit
Public ie As clsIEError
Private Function Init()
Set ie = New clsIEError
End Function
Sub CATMain()
Call Init
' and to use it same as in example 1
ie "test", "title"
' but i am able to use it only like:
' ie.m "test", "title" 'works as expected
Set ie = Nothing
End Sub
why with public default method doesnt work?