MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Feb 28th, 2002, 07:34 AM   #1
JATHGAS
New Member
 
Join Date: Feb 2002
Posts: 3
Default

I send out weekly sales data to 75 sales reps. The file contains data for all sales reps. The data is then used and read in a second excel file that summarizes the data for each rep. This second file is protected so that all cells are locked and hidden. The reps can't change the sheet to view others' data. Right now, however, they can open the workbook containing the data and look at it. My boss wants me to add salary info to this data but needs to be assured that this information can not be directly viewed.

So, does anyone know of a way to hide a sheet and not allow for the sheet to be unhidden?

TIA
JATHGAS is offline   Reply With Quote
Old Jan 4th, 2004, 01:38 AM   #2
garysenter
Board Regular
 
Join Date: Jan 2004
Location: PA
Posts: 88
Default Re: Security

do you still need the answer?
garysenter is offline   Reply With Quote
Old Jan 4th, 2004, 05:48 AM   #3
The Gunslinger
New Member
 
Join Date: Dec 2003
Posts: 30
Default

there are a couple of things you will need to do for this one, yes you can hide the sheet, have a look in the excel help file for 'visible' or search here (if i remember correctly there is a 'veryhidden' option available).... if you hide the sheet, then ensure it is hidden when you save your workbook, and that in the worksheet open event you instruct it to hide it again just incase. protect both the worksheets and workbook (you will need to unprotect and the reprotect the workbook from within the code to set a sheet to visible=false.
protect the project properties with a password as well, and i would look at the 'onkey event' to disable access to the vba editor that way, and also have a search here for disabling menu options.
Placing salary details in a workbook and then hiding the information will need carefull testing, for example, what happens if the user sets macros to off, or presses ctrl+break while your code is running ? .... it is possible but willl need testing carefully
The other thing that comes to mind is an add-in ... maybe you could put the info in an add-in ... and only give the add-in to your boss, have your code reference the add-in only if the boss enters a password first (i think you can do that...have not used add-in and references much)
you can also look at setting a password for when the workbook is opened
hope this gives you somewhere to start looking
The Gunslinger is offline   Reply With Quote
Old Jan 4th, 2004, 06:11 AM   #4
parry
MrExcel MVP
 
parry's Avatar
 
Join Date: Aug 2002
Location: Wellington, New Zealand
Posts: 3,355
Default Re: Security

Gunslinger is onto it.

Yup there is a very hidden option which means that when the user selects Format-Unhide the Sheets option is greyed out. If they know code they could get around it though.

To hide the sheet with code run the following which will make all the sheets that you have selected very hidden. To select multiple sheets select the CTRL key as you click on the tab. Select the sheets you want before running the macro. To unselect the sheets when your finished just click on an individual sheet tab.

Ive also included he macro to unhide the sheets. When you distribute the workbook do so without these macros in the workbook so the user cant run the macro to unhide your sheets.

Code:
Sub HideSheets()
'Select Sheets to be hidden then run the macro.
Dim c
For Each c In ActiveWindow.SelectedSheets
c.Visible = xlSheetVeryHidden
Next c
End Sub

Sub UnhideSheets()
Dim c
For Each c In Sheets
c.Visible = True
Next c
End Sub
parry is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:58 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes