View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
winnie123 winnie123 is offline
external usenet poster
 
Posts: 129
Default Do not Run Macro

Hi,

Is there a way to stop a macro from running if the worksbook has been opened
as Read Only

I have a file and all the worksheets are protected

My macro unprotects and re-protects all the sheets. I have written the
password in my macro and then protected my macro so no one can view. I dont
want any body to know my password so that is why I have added to code. Only
one other person other than me will be allowed to run the macro but I dot
want that person to be able to unprotect any of the worksheets.So hence me
writing the password in the code.

However when I am read only the macro still runs

Can you link a macro to a password on the workbook itself?
or
Tell the macro not to run if workbook has been opened as Read Only.

Your advice appreciated as always.

Thank you

Winnie