Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Chip,
A further question if you mind. How can I get to the thisUser properties later on, I mean during execution of a diffrent procedure. If I write: MyUsers.thisUser.someProp, I get an error that MyUsers is undefined! TIA, Philippe "Chip Pearson" a écrit dans le message de ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need to access the Collection item. E.g.,
MyUsers(1).SomeProp -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Philippe Pons" wrote in message ... Thank you Chip, A further question if you mind. How can I get to the thisUser properties later on, I mean during execution of a diffrent procedure. If I write: MyUsers.thisUser.someProp, I get an error that MyUsers is undefined! TIA, Philippe "Chip Pearson" a écrit dans le message de ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel user enter a store # to query Access data base | Excel Discussion (Misc queries) | |||
Excel paste ask user credentials | Excel Discussion (Misc queries) | |||
store inventory sheet(ex:sports equipment store) | Excel Worksheet Functions | |||
Verifying your credentials for opening content with restricted pe. | Excel Discussion (Misc queries) | |||
Can a service account be embedded in Workbook so that by default the macros are run with service account credentials and not the user credentials??? | Excel Discussion (Misc queries) |