View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jan V. Jan V. is offline
external usenet poster
 
Posts: 2
Default How to make a button conditional

I have a workbook with several sheets and buttons in them.
This excel-file is shared over a p2p network and is password protected
against writing.
The idea is, that everyone can consult the file but only some can change it.
For changing and for consulting some buttons were programmed. If someone
opens the file read-only and tries to make some change via the changing
buttons he or she seems to get away with this ... BUT, if the file is then
closed, several dialoge messages appear (telling that saving is not allowed
and asking if you want to save to a new file). To avoid this, I would like
to make functioning of the changing buttons conditional to the
writing-password. Hitting the changing buttons in read-only status (so
without using the password to open the file) can than result in a simple
message telling this operation is not allowed. This should be possible with
a IF ... THEN ... ELSE statement.

Only, how/where can I get this (status)information (so, whether the file was
or wasn't opened using the password that allows writing and changing) and
combine it with the code the button refers to?

Would appreciate any help on this.

Jan V.