Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Protection Macro Lois Excel Worksheet Functions 2 May 11th 09 04:45 PM
macro protection Lois Excel Worksheet Functions 3 May 8th 09 09:34 AM
Protection Macro Spheon Excel Discussion (Misc queries) 5 July 29th 06 01:16 PM
macro for protection ynissel Excel Discussion (Misc queries) 3 August 3rd 05 09:52 PM


All times are GMT +1. The time now is 11:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"