#1
|
|||
|
|||
Password Protect a Macro
Does anyone know how to require a password to run a macro in word? |
#2
|
|||
|
|||
At the start of the code, use the InputBox function to ask the user to put in the password. Compare the returned string to the real password. If they aren't equal, execute the command Exit Sub.
To prevent users from simply opening the macro editor and reading the password from the code, apply a password to the code project (you'll find that in the macro editor's menu Tools > Properties > Protection). That password is very easy to break, but most users won't know that. |
#3
|
|||
|
|||
Brilliant, thanks very much JJFreedman
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Password protect a table in Word | Mark212 | Word VBA | 2 | 01-14-2015 02:28 PM |
Password protect Docx documents | timm@bicyclegermany.com | Word | 3 | 11-05-2011 03:46 PM |
Here!! Help me to remove password protect from pdf | priya | Word | 1 | 09-17-2011 10:35 AM |
How can I protect all my MSW documents with a password ? | Antonio Machado | Word | 0 | 07-05-2010 07:55 PM |
password protect excel file? | Dawg751 | Excel | 2 | 01-28-2010 06:23 AM |