+ Reply to Thread
Results 1 to 9 of 9

Completely hide a VBA module from outside access

  1. #1
    Registered User
    Join Date
    03-10-2019
    Location
    india
    MS-Off Ver
    2019
    Posts
    4

    Completely hide a VBA module from outside access

    I have developed some VBA code. Out of those a lot are sub procedures which I don't want the user to access from outside. The obvious answer is making them private. However, even then the user can run the procedure from view macro window by typing out the name.

    How do I completely protect the code from outside access.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    5,767

    Re: Completely hide a VBA module from outside access

    .
    You can't. Sorry.

    Excel has built-in password protection in the VBE to secure your code but it is very easily by-passed by the average user
    if they are willing to do a little research on the internet.

    There are Third Party companies that produce software which obscures and/or password protects your code. Those are better
    at preventing the average users from accessing your code. Downside ... those too can be hacked / they cost money.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham
    MS-Off Ver
    365
    Posts
    8,472

    Re: Completely hide a VBA module from outside access

    If you simply want to prevent users from running those macros, you can add an argument to the sub like
    Please Login or Register  to view this content.
    and then call it like
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    5,124

    Arrow Re: Completely hide a VBA module from outside access


    Quote Originally Posted by Fluff13 View Post
    If you simply want to prevent users from running those macros []
    Or just using Private statement procedures are not visible in the Macros list via Alt F8 key combo

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham
    MS-Off Ver
    365
    Posts
    8,472

    Re: Completely hide a VBA module from outside access

    Quote Originally Posted by Marc L View Post
    Or just using Private statement procedures are not visible in the Macros list via Alt F8 key combo
    Agreed, but as the OP stated, you can still type the name of the macro & run it.

  6. #6
    Registered User
    Join Date
    03-10-2019
    Location
    india
    MS-Off Ver
    2019
    Posts
    4

    Re: Completely hide a VBA module from outside access

    Thank you for answering. That's not very comforting to hear.

  7. #7
    Registered User
    Join Date
    03-10-2019
    Location
    india
    MS-Off Ver
    2019
    Posts
    4

    Re: Completely hide a VBA module from outside access

    I used a similar technique and named the variable as dummy.

  8. #8
    Registered User
    Join Date
    03-10-2019
    Location
    india
    MS-Off Ver
    2019
    Posts
    4

    Re: Completely hide a VBA module from outside access

    Quote Originally Posted by Marc L View Post

    Or just using Private statement procedures are not visible in the Macros list via Alt F8 key combo
    True, but can be executed by simply typing the name manually.

  9. #9
    Forum Guru
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,859

    Re: Completely hide a VBA module from outside access

    Make the name sufficiently long and change the name to something created by a randomizer (which could be your fingers).

    Lewis

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hide Module for certain users
    By MaxOtis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-05-2017, 11:34 PM
  2. Access a cell in Sheet2 with VBA in Module 1
    By rmhSeattle in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-25-2015, 09:48 PM
  3. How to access Add-in module from VBA macro
    By tweaver1960 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2011, 06:25 AM
  4. Module to Hide Columns
    By montego in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2010, 09:02 PM
  5. how to access Sheet module, normal module, Worbook module to type code
    By alibaba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2009, 07:51 AM
  6. Access's module in Excel (use DAO)?
    By aloz in forum Excel General
    Replies: 1
    Last Post: 02-18-2005, 04:50 AM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1