Why does the EnableSelection-xlNoSelection stick thru the user interface?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm asking this question, because I have a specific need to lock many worksheets at one time, and not allowing any selection of cells when I'm done. I've written a VBA scription to do this. As has been posted before, the EnableSelection-xlNoSelection sticks thru the user interface, but you must insert code into the Excel that you protected for it to stick. Why does the EnableSelection-xlNoSelection stick thru the user interface? My users do not want to enable macros every time.

Does anyone know of ANY way to make this property stick, like it does by using the Protection user interface? I appreciate any help on this.
 
There are a number of properties that are not persistent, such as
EnableSelection, ScrollArea and Protect with UserInterfaceOnly set to True.
AFAIK this is by design and there is no way to change it.

--

Vasant



IanS said:
I'm asking this question, because I have a specific need to lock many
worksheets at one time, and not allowing any selection of cells when I'm
done. I've written a VBA scription to do this. As has been posted before,
the EnableSelection-xlNoSelection sticks thru the user interface, but you
must insert code into the Excel that you protected for it to stick. Why
does the EnableSelection-xlNoSelection stick thru the user interface? My
users do not want to enable macros every time.
Does anyone know of ANY way to make this property stick, like it does by
using the Protection user interface? I appreciate any help on this.
 
Thanks for the info. So, just to clarify, even though these properties are not persistent, something in the UserInterface can make the property persistent? I am very new to excel programming, and I just find it strange that it is persistent by using the Protection->Protect Sheet on the Tools menu, and the xlNoSelection sticks when I reopen, but when I do the same thing thru code, it doesn't stick.
 
Strange, but true.

But be a little careful if you share the workbook with people who use earlier
versions of excel.

The code works nicely in that case.
 

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

Back
Top