Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
make sure macro be loaded without user intervention
i hv a code which protects selected columns according to users' login name,
so that unautorized user can't edit on columns on which he is not supposed to. there is a problem, user has to "enable" macro when he opens the workbook. If he disable the macro, then the whole protection dies as there is no macro to run to check login name and authorization. anybody can advice? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
make sure macro be loaded without user intervention
Soe,
Why not try defaulting the columns to protected and having the macro UNprotect the columns. That way, if the user disables the macro, he cannot disable the protection. Regards, Ryan -----Original Message----- i hv a code which protects selected columns according to users' login name, so that unautorized user can't edit on columns on which he is not supposed to. there is a problem, user has to "enable" macro when he opens the workbook. If he disable the macro, then the whole protection dies as there is no macro to run to check login name and authorization. anybody can advice? . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
make sure macro be loaded without user intervention
Maybe you can make the file read-only with a note that
macros must be enabled to write to the sheet. When the macro is initiated, it can disable read only then protect the columns. Another way is to have the file on your computer so other users have to network the file for access. Or if there is only one computer, use Administration rights to adjust the settings in the toolbars. Remove the enable/disable macro toolbar setting altogether so it is not present. This way there is no option. There is a way to do what you want but it is a secret and I don't know what it is. -----Original Message----- i hv a code which protects selected columns according to users' login name, so that unautorized user can't edit on columns on which he is not supposed to. there is a problem, user has to "enable" macro when he opens the workbook. If he disable the macro, then the whole protection dies as there is no macro to run to check login name and authorization. anybody can advice? . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
make sure macro be loaded without user intervention
You can do a couple of things:
1) set the Tools|Macro|Security... menu option in Excel to Low (this will enable the running of macros ALL the time - careful though, since this will run malicious macros from nefarious sources as well). You could also digitally sign your macro, which I believe will allow you to change the security level to Medium. 2) In a VBA module, create a macro called "Sub Auto_Open". Excel will automatically execute all code within the Auto_open subroutine whenever the file is opened. You can program within the Auto_open routine, code that looks at the users login name by using the "Application.UserName" function, which will give the name of the current user. From there restrict who has access to what. Also look up "UserAccessList" and UserAccess Object" from within the Visual Basic Help structure within Excel. To get to the VBA portion from Excel, press the [Alt] + [F11] keys simultaneously. Andrew Lenczycki -----Original Message----- i hv a code which protects selected columns according to users' login name, so that unautorized user can't edit on columns on which he is not supposed to. there is a problem, user has to "enable" macro when he opens the workbook. If he disable the macro, then the whole protection dies as there is no macro to run to check login name and authorization. anybody can advice? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do i make office available to multiple user accounts | Setting up and Configuration of Excel | |||
Using VBA to make a user input a note when making changes to a cel | Excel Worksheet Functions | |||
Excel to Oracle without user intervention | Excel Discussion (Misc queries) | |||
How do I make my list name for drop down box conditional on user e | Excel Discussion (Misc queries) | |||
Forcing the user to make entries in a specified worksheet | Excel Discussion (Misc queries) |