| | |
VB and Excel Programming
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2004
Posts: 1,620
Reputation:
Solved Threads: 51
Hello,
This might be in the wrong place. My question pertains to MS Excel, and using Visual Basic for Applications (VBA).
We have a user that would like to hide one of her worksheets within a workbook. She would like the sheet to be securely hidden.
I found this piece of code:
and the sheet does disappear.
There are two problems:
1) I don't like the Macro warning. Hints that something might be up, and if they disable the macros, then this visibility thing does not work.
2) Anyone can go into the Visual Basic for Applications menu, and see all of the worksheets in broad daylight. They can highlight the hidden sheet, and go to the properties, and unhide it with their mouse. Data revealed.
I am going to discuss with the user the wisdom of trying to do this. If she wants to go ahead though, and do "security through obscurity", then that is her call. What I want to be sure of though is that there isn't any other way to place a password on the VBA menu, or perhaps prevent the sheets from displaying on the VBA menu.
If anyone has ideas, please let me know. I am not very proficient in VBA, so please spell out the steps taken.
Thanks,
Christian
This might be in the wrong place. My question pertains to MS Excel, and using Visual Basic for Applications (VBA).
We have a user that would like to hide one of her worksheets within a workbook. She would like the sheet to be securely hidden.
I found this piece of code:
VB.NET Syntax (Toggle Plain Text)
Sub HideSheet() Sheets("Sheet2").Visible = xlVeryHidden End Sub
and the sheet does disappear.
There are two problems:
1) I don't like the Macro warning. Hints that something might be up, and if they disable the macros, then this visibility thing does not work.
2) Anyone can go into the Visual Basic for Applications menu, and see all of the worksheets in broad daylight. They can highlight the hidden sheet, and go to the properties, and unhide it with their mouse. Data revealed.
I am going to discuss with the user the wisdom of trying to do this. If she wants to go ahead though, and do "security through obscurity", then that is her call. What I want to be sure of though is that there isn't any other way to place a password on the VBA menu, or perhaps prevent the sheets from displaying on the VBA menu.
If anyone has ideas, please let me know. I am not very proficient in VBA, so please spell out the steps taken.
Thanks,
Christian
•
•
•
•
Originally Posted by kc0arf
Hello,
This might be in the wrong place. My question pertains to MS Excel, and using Visual Basic for Applications (VBA).
We have a user that would like to hide one of her worksheets within a workbook. She would like the sheet to be securely hidden.
I found this piece of code:
VB.NET Syntax (Toggle Plain Text)
Sub HideSheet() Sheets("Sheet2").Visible = xlVeryHidden End Sub
and the sheet does disappear.
There are two problems:
1) I don't like the Macro warning. Hints that something might be up, and if they disable the macros, then this visibility thing does not work.
2) Anyone can go into the Visual Basic for Applications menu, and see all of the worksheets in broad daylight. They can highlight the hidden sheet, and go to the properties, and unhide it with their mouse. Data revealed.
I am going to discuss with the user the wisdom of trying to do this. If she wants to go ahead though, and do "security through obscurity", then that is her call. What I want to be sure of though is that there isn't any other way to place a password on the VBA menu, or perhaps prevent the sheets from displaying on the VBA menu.
If anyone has ideas, please let me know. I am not very proficient in VBA, so please spell out the steps taken.
Thanks,
Christian
Second question, you can password protect your vba project so even if someone does go the the vba menu they will not see the modules or worksheets. Look under Tools->VBA Project properties from the VBA window.
Thirdly the code you've written above only needs to be used once. Why not set the worksheet to xlVeryHidden before you distribute it? You don't need to hide it every time you open the file. Once you've set it to xlVeryHidden and saved the file it's 'very hidden' until someone else makes it visible from another bit of vba code.
Hope that helps.
Mark Nemtsas
Time and Billing Software - Time Tracking Software - Roller Shutters - Roller Blinds -
Baby Books
Time and Billing Software - Time Tracking Software - Roller Shutters - Roller Blinds -
Baby Books
![]() |
Similar Threads
- Printing without Crystal Reports - Simple "Hello, world." in VB 2008 (VB.NET)
- Positioning an image using Excel (VB.NET)
- Anything and Everything (Geeks' Lounge)
- Getting started programming Windows (C++)
- Tell us about yourself! (Community Introductions)
- Microsoft Excel Programming problem (Windows Software)
- What Language is used in software like Adobe Photoshop? (C++)
Other Threads in the VB.NET Forum
- Previous Thread: How to sort the rows in the datagrid and update it successfully?
- Next Thread: Need Help for identify the Sorting Action
| Thread Tools | Search this Thread |
.net .net2008 2008 access advanced application array basic beginner browser button buttons center checkbox click client code combo convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function generatetags html images input intel internet listview map mobile module monitor msaccess net number objects open panel pdf picturebox picturebox2 port position print printing read regex remove right-to-left save search searchvb.net serial settings shutdown socket sorting sqldatbase sqlserver survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol validation vb vb.net vba vbnet visual visualbasic visualbasic.net visualstudio.net web winforms winsock wpf wrapingcode xml year






