Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection macro
I am creating a macro that changes passwords on a spreadsheet
The problem is when the spreadsheet's password isn't what is expected by the macro, and it comes up with the macro error box with the de-bug option, etc How can I alter the macro so that when the password is not correct it displays a message box saying "invalid password", and hitting "ok" would halt the macro Or better yet, can a macro detect a password? Or at least return a true/false statement concerning a password Thanks in advanc Labrat. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection macro
take a look he
http://www.mcgimpsey.com/excel/removepwords.html In article , Labrat wrote: I am creating a macro that changes passwords on a spreadsheet. The problem is when the spreadsheet's password isn't what is expected by the macro, and it comes up with the macro error box with the de-bug option, etc. How can I alter the macro so that when the password is not correct it displays a message box saying "invalid password", and hitting "ok" would halt the macro? Or better yet, can a macro detect a password? Or at least return a true/false statement concerning a password? Thanks in advance Labrat. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection macro
Labrat
Something like this x = Password if x < password then count = count + 1 msgbox = "Incorrect Password, try again" if count = 3 then Exit Sub end if End if Not tested -----Original Message----- I am creating a macro that changes passwords on a spreadsheet. The problem is when the spreadsheet's password isn't what is expected by the macro, and it comes up with the macro error box with the de-bug option, etc. How can I alter the macro so that when the password is not correct it displays a message box saying "invalid password", and hitting "ok" would halt the macro? Or better yet, can a macro detect a password? Or at least return a true/false statement concerning a password? Thanks in advance Labrat. . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection macro
Here is one way:
On Error Goto BadPW ActiveWorkbook.Unprotect "Your password here" BadPW: MsgBox "Invalid Password!", vbOkOnly + vbExclamation Exit Sub -Jack -----Original Message----- I am creating a macro that changes passwords on a spreadsheet. The problem is when the spreadsheet's password isn't what is expected by the macro, and it comes up with the macro error box with the de-bug option, etc. How can I alter the macro so that when the password is not correct it displays a message box saying "invalid password", and hitting "ok" would halt the macro? Or better yet, can a macro detect a password? Or at least return a true/false statement concerning a password? Thanks in advance Labrat. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
Protection Macro | Excel Worksheet Functions | |||
macro protection | Excel Worksheet Functions | |||
Protection Macro | Excel Discussion (Misc queries) | |||
macro for protection | Excel Discussion (Misc queries) |