Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect a macro
I've got a workbook that email out to about 50 people each month. have a "homepage" where I've inserted several Macro buttons an hyperlinks. Some of the macros, I only want available to 3 or 4 people. Can I mak those macros where it prompts you for a password if you try to ru them? If so, how do I assign the password? Thank ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect a macro
There isn't any built in way to password protect the execution of a macro --
you have to write the code to prompt for a password. For example, Sub TheMacro() If InputBox("Enter a password:") < "the_password" Then Exit Sub End If ' ' rest of code ' End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "rbanks" wrote in message ... I've got a workbook that email out to about 50 people each month. I have a "homepage" where I've inserted several Macro buttons and hyperlinks. Some of the macros, I only want available to 3 or 4 people. Can I make those macros where it prompts you for a password if you try to run them? If so, how do I assign the password? Thanks ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect a macro
rbanks
Sub pass() enterpass = InputBox("Enter Password To Run Macro") If enterpass < "rbanks" Then GoTo notright MsgBox "You have got it right" Exit Sub notright: MsgBox "Incorrect Password Try Again" End Sub Be sure to set Protection on your VBA Project so's others can't see your macro password. Note: there are Password crackers out there that can break the password on your VBA Project. Excel is not secure from those who would wish to snoop but you can keep out the casual and not-so-snoopy users. Gord Dibben XL2002 On Fri, 21 Nov 2003 14:18:52 -0600, rbanks wrote: I've got a workbook that email out to about 50 people each month. I have a "homepage" where I've inserted several Macro buttons and hyperlinks. Some of the macros, I only want available to 3 or 4 people. Can I make those macros where it prompts you for a password if you try to run them? If so, how do I assign the password? Thanks ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protect macro | Excel Discussion (Misc queries) | |||
How to protect my macro | Excel Discussion (Misc queries) | |||
Protect Macro Coding | Excel Programming | |||
protect - macro? | Excel Programming | |||
Macro to protect with pword in 97 | Excel Programming |