Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
erik
 
Posts: n/a
Default locking tabs w/macros

i have a workbook that employees use to track project progress. they enter
project data into sheet 1 and vbscript macros manipulate this data and output
it in various ways on worksheets 2-15. i want to lock sheets 2-15 so
employees cannot enter data, but when i protect those sheets the macros are
no longer permitted to work. is there a way i can prevent cell editing by
USERS but permit editing by MACROS? this seems like it should be fairly
obvious, but i cant figure it out. thanks in advance!
  #2   Report Post  
KL
 
Posts: n/a
Default

Hi eric,

1) you might want to use the following instruction when protecting the
sheets:

ActiveSheet.Protect Password:="Password", UserInterfaceOnly:=True

this line has to be executed every time you open the file as the
UserInterfaceOnly parameter is not saved, so you may want to build it into
the Workbook_Open event.

2) another option is to include into your code instructions that would
unprotect and then protect your sheets, e.g:

ActiveSheet.Unprotect "Password"
'.....your code
ActiveSheet.Protect "Password"

Regards,
KL


"erik" wrote in message
...
i have a workbook that employees use to track project progress. they enter
project data into sheet 1 and vbscript macros manipulate this data and
output
it in various ways on worksheets 2-15. i want to lock sheets 2-15 so
employees cannot enter data, but when i protect those sheets the macros
are
no longer permitted to work. is there a way i can prevent cell editing by
USERS but permit editing by MACROS? this seems like it should be fairly
obvious, but i cant figure it out. thanks in advance!



  #3   Report Post  
erik
 
Posts: n/a
Default


KL, thanks so much - your option #2 worked perfectly!


"KL" wrote:

Hi eric,

1) you might want to use the following instruction when protecting the
sheets:

ActiveSheet.Protect Password:="Password", UserInterfaceOnly:=True

this line has to be executed every time you open the file as the
UserInterfaceOnly parameter is not saved, so you may want to build it into
the Workbook_Open event.

2) another option is to include into your code instructions that would
unprotect and then protect your sheets, e.g:

ActiveSheet.Unprotect "Password"
'.....your code
ActiveSheet.Protect "Password"

Regards,
KL


"erik" wrote in message
...
i have a workbook that employees use to track project progress. they enter
project data into sheet 1 and vbscript macros manipulate this data and
output
it in various ways on worksheets 2-15. i want to lock sheets 2-15 so
employees cannot enter data, but when i protect those sheets the macros
are
no longer permitted to work. is there a way i can prevent cell editing by
USERS but permit editing by MACROS? this seems like it should be fairly
obvious, but i cant figure it out. thanks in advance!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A "Document Map" of worksheet tabs for Excel BCS Setting up and Configuration of Excel 2 June 22nd 05 01:33 PM
3 format cell tabs hidden in excel dialog box pjbjamison Excel Discussion (Misc queries) 1 May 4th 05 04:50 PM
Tabs accross of bottom of sheet are not showing robert Excel Discussion (Misc queries) 3 April 22nd 05 09:29 PM
Hidding Tabs Aviator Excel Discussion (Misc queries) 1 December 15th 04 04:55 PM
Sheet tabs disappear sometimes in Internet Explorer Jan Nordgreen Excel Discussion (Misc queries) 0 December 6th 04 01:34 AM


All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"