enable /disable customised button on toolbar

M

mango

Dear All,
Is there a way for customised button(macro) to appear on toolbar only when
user provide password? i got 1 button on worksheet whereby if user enter
correct
password then button will be shown on toolbar.
can?
Please have yr advice.

Thanks alot
 
M

Myrna Larson

Have your macro create the button and put it on the toolbar only if the
password is correct. Delete it when the workbook is closed. You would use the
Workbook_OPen and Workbook_BeforeClose events for these things.
 
M

mango

how the scripts like? can i put in 1 of the event (not workbook open) to
enable and disable can put in workbook before close. i cannot put in workbook
open as not all user can use the button on the toolbar.
or another way is in order to use the customised button, user must provide
password when click on the customised button. then in this case i can put in
the toolbar all the time. but how the script like?

which is simpler?
thanks alot
 
F

Frank Kabel

Hi
you can add one button for enabling you menu bar. This button should be
available for all users. Within the assigned macro to this button use
something like:

sub foo()
dim res as string
res = inputbox "Enter your password"
if res = "your_password" then
'enable menu bar
end if
end sub
 
M

mango

thanks frank. but how to enable or disable customised button on the toolbar?
i mean what is the coding likes?
thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top