Chip, if I run the code on my PC (Excel 2003) I can't select cells in
the relevant sheet, but another person runs it from their PC (Excel
2000) and you can select cells.
I also notice that on one sheet of this workbook the .DisplayGridlines
= False is not activated (but it is when I run it - part of the same
code)
I've even recorded a macro (on the 2000 PC) to remove the
ActiveSheet.EnableSelection = xlUnlockedCells and it works, yet when
the particular code I'm running is run, no such luck
Must sheets be visible when .EnableSelection = xlUnlockedCells is run?
Chip Pearson wrote:
> It should work in all versions since at least 97, as far as I know.
> Specifically what do you mean by "doesn't work"? Details count.
>
>
> --
> Cordially,
> Chip Pearson
> Microsoft MVP - Excel
> Pearson Software Consulting, LLC
> www.cpearson.com
> (email address is on the web site)
>
>
> "Sean" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > The code worked yesterday, using Office 2003, but now today with
> > another user using Office 2000 it hasn't. Is the code not supported in
> > Office 2000?
> >
> >
> >
> > Chip Pearson wrote:
> >> There's no need to Select or Activate the sheet (or anything else, for
> >> that
> >> matter), and doing so may have unintended consequences (e.g., the rest of
> >> the procedure may rely on a particular sheet being active).
> >>
> >> Instead, use code like
> >>
> >> With Sheets("E-Mail")
> >> .Protect
> >> .EnableSelection = xlUnlockedCells
> >> End With
> >>
> >>
> >> --
> >> Cordially,
> >> Chip Pearson
> >> Microsoft MVP - Excel
> >> Pearson Software Consulting, LLC
> >> www.cpearson.com
> >> (email address is on the web site)
> >>
> >>
> >>
> >> "Mike" <(E-Mail Removed)> wrote in message
> >> news:E679602B-97AC-4D32-9F0D-(E-Mail Removed)...
> >> > try
> >> >
> >> > Sheets("E-Mail").Activate
> >> > ActiveSheet.protect
> >> > ActiveSheet.EnableSelection = xlUnlockedCells
> >> >
> >> > Mike
> >> > "Sean" wrote:
> >> >
> >> >> I have the following code, which I though would stop the ability of
> >> >> the
> >> >> user to select locked cells, but it doesn't. It protects my sheet, but
> >> >> user can still select cells. Do I have something wrong?
> >> >>
> >> >>
> >> >> Sheets("E-Mail").Activate
> >> >> ActiveSheet.EnableSelection = xlNoSelection
> >> >> ActiveSheet.Protect Password:="1234"
> >> >>
> >> >>
> >