Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 06-01-2010
Member
 
Join Date: Aug 2006
Posts: 121
How to Hide VBA Code?

I use lot of template sheets to generate the charts and also I write the VBA code for the automation of certain functions in Excel file and I have save them as XLS file. I have to give it to my clients and they want to run my programs on their site. And that requires the copy of the main Excel workbook that contains my templates and VBA code. Now I don't want to let them see my contents and want to hide them. How can I hide the VBA code .?Has anyone did this before?? Please help me by providing the helpful information.!
__________________
Whats my name again? I spend so much time looking at code i fogot my own name ahhh!
Reply With Quote
  #2  
Old 06-01-2010
Member
 
Join Date: May 2008
Posts: 2,008
Re: How to Hide VBA Code?

For keeping your VBA code safe you can also give the password to that file. You can give the password as described in the following steps :
  • First open the VB Editor and select your project in the Projects window that you want to give the password.
  • Then open the VB Editor and select your project in the Projects window.
  • Choose [project name] Properties from the Tools menu.
  • Then select the Protection tab from the Project Properties dialog box.
  • Check the option "Lock project for viewing", set the password and then click OK.
  • Once you give the password, saved and close it. From next time a password will be required to view or modify the code when the workbook is opened.
Hope that your problem is solved..
Reply With Quote
  #3  
Old 06-01-2010
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: How to Hide VBA Code?

Even I recommend you to activate the worksheet to be protected, then choose Tools - Protection - Protect Sheet. After doing this you will be asked for the password. If you give the password, later on for working on Worksheet that password will be required. Every cell has two two key attributes : Hidden and Locked. By default, all cells are locked, but they are not hidden. I know how to hide the Cell. Follow the steps to hide the Cell :
  • Select the cell or the cells that you want to unlock.
  • Then choose the option format cells.
  • Click the Protection tab which will be in the Format Cells dialog box.
  • Check the option of Hidden.
Note : For making the change of Hidden attribute of a cell the worksheet should be protected.
Reply With Quote
  #4  
Old 06-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: How to Hide VBA Code?

According to me the worksheet protection is not a security feature. Actually the encryption system used by the Excel is very simple for worksheet protection. To protect the worksheet with a password, the other users can also used to unprotect the worksheet. So, it's very easy to break a worksheet which is password-protected. I also think that worksheet protection is not really intended to prevent people from accessing data in a worksheet. Excel is not the best platform to keep your data secure.
Reply With Quote
  #5  
Old 06-01-2010
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: How to Hide VBA Code?

By using a "very hidden" statement the maximum user can be kept away from viewing the sheet. Use a following VBA statement to make a sheet very hidden :
Sheets("Sheet1").Visible = xlVeryHidden
When you try to see the list of hidden sheets, a "very hidden" sheet will not appear in that list. This will appear only when the user selects Format - Sheet - Unhide. This task can be done only by those who know the VBA well.
Reply With Quote
  #6  
Old 06-01-2010
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: How to Hide VBA Code?

I would recommend you to protect your Workbook. You can do this by selecting the Tools - Protection - Protect Workbook. The Structure checkbox should be checked in the Protect Workbook dialog box. If you are giving any password, it will be required to unprotect the workbook. When a Workbook is protected, the user may not do the following things :
  • Hide a sheet
  • Add a sheet
  • Delete a sheet
  • Move a sheet
  • Unhide a sheet
  • Rename a sheet
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Hide VBA Code?"
Thread Thread Starter Forum Replies Last Post
How can I hide JavaScript code of my application? Emiliana Software Development 6 22-08-2011 12:10 AM
Auto-Hide toolbar won't hide? Geoff from LA Vista Help 8 18-10-2009 06:52 AM
How to hide source code in JAVA Jacek Software Development 4 11-05-2009 09:42 AM
run and hide one. exe Big B Windows Software 4 01-11-2008 01:47 PM
Hide the source code of a Web page Antonio00 Software Development 2 17-09-2008 06:23 PM


All times are GMT +5.5. The time now is 11:02 PM.