Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sean,
You code works for me. But ActiveSheet.EnableSelection is not a persistent property; you have to set it every time the file is opened, may in the Workbook_Open() event. NickHK "Sean" wrote in message ups.com... 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" |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Guys, your option worked Mike
Mike wrote: 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" |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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" |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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" |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ups.com... 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" wrote in message ... 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" |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ups.com... 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" wrote in message ... 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" |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I again tested this same code this AM and it works when running on 2003
but not on 2000 Sean wrote: 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" wrote in message ups.com... 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" wrote in message ... 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" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Up down arrow keys do not select cells if select locked cells unch | Excel Discussion (Misc queries) | |||
Excel 2007 Pivot Tables - Page Field Row Height; Disable Select MultItems | Excel Discussion (Misc queries) | |||
how do you "select locked cells" w/o "select unlocked cells"? | Excel Discussion (Misc queries) | |||
Code to select 'Disable Macro' when opening an EXTERNAL FILE | Excel Programming | |||
disable mulitple select on pivot page field | Excel Programming |