View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Using classes to store user credentials

Create a Collection object as a global variable (declared outside
of and prior to any procedure in the module), and then use
Set/New to create an instance of your class, then store that
instance in the collection. E.g.,


Dim MyUsers As New Collection

Sub MySub()
Dim thisUser As clsUser
Set thisUser = New clsUser
MyUsers.Add thisUser
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Philippe Pons" wrote in
message ...
Hi,

I consider using a class to store if the user has been
authorized.
Something like:
Dim thisUser as new clsUser
thisUser.IsAuthorized = True

But I don't know how to preserve this instance of the class,
together with
it's properties, throughout the life of the application.

Could you help me?

Thank's in advance

Philippe