Results 1 to 6 of 6

Thread: How to Hide VBA Code?

  1. #1
    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!

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    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..

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    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.

  4. #4
    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.

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    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.

  6. #6
    Join Date
    Feb 2008
    Posts
    1,852

    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

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,616,911.66448 seconds with 17 queries