password a macro or command button

go2review.com

Registered User.
Local time
Today, 13:12
Joined
Mar 31, 2009
Messages
13
I have used a macro to download information into an excel spread sheet and this works fine.using a command button it downloads fine but the file is very sensitive and i want the macro or button to be password protected is this possible
 
the simplest way is to say

if inputbox("Enter Password to continue")<>"correctpassword" then
msgbox ("sorry - wrong password")
exit sub
end if


the only trouble is that with an input box, the entry cant be "passworded" ie masked with **** symbols. if you need this, you have to design your own form to do this, and it becomes trickier
 
sorry to sound thick as im not that well adversed to this, where do i put this formula ?
 
not sure with a macro

but just put it at the start of the click event code for a button
 
Last edited:
I have used a macro to download information into an excel spread sheet and this works fine.using a command button it downloads fine
the way i read this quote is two fold:

1) I use macro commands to download to Excel
2) The macro is INITIATED by a command button.

if #2 is true, you're going to have to convert you're macro into code with the code converter from the interface (there is a button for this on the toolbar). because i don't think you can just NAME a macro with a CLICK() event AND pour code on top of that is well. Gemma' code has to go before any macro action. isnt that right dave?
 
the button on the opening page is the one i want to password protect
 

Attachments

Users who are viewing this thread

Back
Top Bottom