Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Hide/Unhide worksheets based on login?

Is it possible to have an Excel spreadsheet that hides/unhides
worksheets based on the Active Directory network login? If that is not
possible, how about a login into the Workbook and then do hide/unhide
based on that?

Advice on how to do either?

Thanks in Advance.

Joe

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Hide/Unhide worksheets based on login?

Environ("UserName")

should get you the login name. My suggestion would be to use the very hidden
attribute of the visible property. Additionally when the file is being closed
make sure that you set the hidden property for all of the confidential sheets
to very hidden. Otherwise if the book is opened with macros disabled the
confidential sheets may still be visible. Ensure that the code to hide and
unhide the sheets is not accessible through the Macro's menu - "Option
Private Module" - at the top of the code will ensure that the macro's are
not visible to the user. Make shure that your code is protected with a
password. Finally after all of this there is nothing to stop the user from
writing a simple script such as this to unhide the sheets anyways...

sub UnhideAll
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.visible = xlSheetVisible
next wks

exit sub
--
HTH...

Jim Thomlinson


"jej1216" wrote:

Is it possible to have an Excel spreadsheet that hides/unhides
worksheets based on the Active Directory network login? If that is not
possible, how about a login into the Workbook and then do hide/unhide
based on that?

Advice on how to do either?

Thanks in Advance.

Joe


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Hide/Unhide worksheets based on login?

Hmm,

Thanks Jim - I'll give it a try.

Joe

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
Macro to hide and unhide based on criteria [email protected] Excel Discussion (Misc queries) 1 June 5th 06 08:05 PM
Hide and/or Unhide Worksheets Rob Excel Programming 5 January 13th 06 08:31 PM
Hide and unhide worksheets Profairy[_6_] Excel Programming 3 June 9th 04 04:20 PM
Unhide sheets based on NT login MaxBrit Excel Programming 4 May 6th 04 12:40 PM
Hide/Unhide worksheets help Jeremy Gollehon[_2_] Excel Programming 2 July 31st 03 10:05 PM


All times are GMT +1. The time now is 12:30 AM.

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

About Us

"It's about Microsoft Excel"