Thread: Protection
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Project Mangler Project Mangler is offline
external usenet poster
 
Posts: 63
Default Protection

Hi AB,

I've seen this before - people suggesting that the code needs to
unprotect/write/re-protect.

The userinterfaceonly parameter allows code to modify the sheet, but not the
user.

Am I missing something?

"AB" wrote in message
...
You could:
1. protect (as per earlier post by Prject Mangler) your wb or ws
(depending on what you want)
2. write your 'Run' code so that it:
2.1. unprotects the wb/ws
2.2. does the thing you want
2.3. re-protects teh wb/ws again.
Additional (not fool-proof) feature you can implement is you can
change your fileaccess to read-only on the fly, if you want to.

This way your file would be 'open' for user to mess about only during
the macro run time (during which they can't mess around with it) or
when it's read-only (and then you almost don't care).