brunces
06-29-2007, 07:27 AM
Friends,
I have this worksheet which, when it's opened, shows a login form. The user logs in and his information is saved in two public variables, strUser and strLevel, through VLOOKUP function (there's a table for users, passwords and levels).
Some sheets are reachable based on user's level (admin, user, guest).
The point is: When I save this worksheet (while it's opened, not before closing document) those public variables have their contents cleared. Then, nothing else works fine within the worksheet. So, I have to click on "Change User" button (it opens login form) and log in again, so that those variables are filled again.
Please, is there any way to avoid Excel from erasing those public variables contents? Or maybe, make it recover those values after saving document?
I don't know if this could be the right solution, but I've tried to copy those variables contents to cells in a sheet (using the event Worksheet_BeforeSave), so that I could tell the variables to recover their contents from those cells later. But, how do I do that automatically after saving?
Thank you very much for your attention. :)
Brunces
I have this worksheet which, when it's opened, shows a login form. The user logs in and his information is saved in two public variables, strUser and strLevel, through VLOOKUP function (there's a table for users, passwords and levels).
Some sheets are reachable based on user's level (admin, user, guest).
The point is: When I save this worksheet (while it's opened, not before closing document) those public variables have their contents cleared. Then, nothing else works fine within the worksheet. So, I have to click on "Change User" button (it opens login form) and log in again, so that those variables are filled again.
Please, is there any way to avoid Excel from erasing those public variables contents? Or maybe, make it recover those values after saving document?
I don't know if this could be the right solution, but I've tried to copy those variables contents to cells in a sheet (using the event Worksheet_BeforeSave), so that I could tell the variables to recover their contents from those cells later. But, how do I do that automatically after saving?
Thank you very much for your attention. :)
Brunces