+ Reply to Thread
Results 1 to 3 of 3

Disabling the 'Run Macro' button

  1. #1
    Registered User
    Join Date
    12-29-2004
    Posts
    2

    Red face Disabling the 'Run Macro' button

    Hello Folks!

    I have some VBA code in my worksheet that protects the worksheet.

    I have protected the code by giving a password for the code.

    I have disabled the save as, cut copy etc.

    My problem is the 'Run Macro' button from the visual basic tool bar. When the user clicks this one it gives the list of all the macros and the user is free to run anything from here.

    This basically gives access to all the password protected macros.

    Can somebody tell me how to disable this button or the whole visual basic toolbar.

    Thanks.

  2. #2
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    You can make the macros invisible in any number of ways.

    One way is to put the word Private in front of each macro name.

    Another way is to put "Private Module" at the top of each module.

    Another way is to put a fake parameter in each macro statement ... for example:

    Sub myMacro(x)

    Then, when you call the macro, you'll need to use something like this:

    Call myMacro(1)

    - Pete

  3. #3
    Registered User
    Join Date
    07-16-2004
    Posts
    56
    Private Sub Workbook_Open()
    Application.CommandBars.ActiveMenuBar.Enabled = False
    End Sub

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.CommandBars.ActiveMenuBar.Enabled = True
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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