+ Reply to Thread
Results 1 to 12 of 12

Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

  1. #1
    Registered User
    Join Date
    05-17-2011
    Location
    Wayzata, Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    7

    Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    I have a .xlsm workbook (Excel 2007) that has macros, and the macros (and their code) are visible in Developer/VisualBasic as you would expect. However, their routine names are not visible in Developer/Macros.

    The macros involve .ProtectSharing method, which likely caused the problem, but now I want to fix this issue before proceeding to debug the macros.
    Last edited by wadevcamp; 12-22-2011 at 03:11 PM.

  2. #2
    Registered User
    Join Date
    05-17-2011
    Location
    Wayzata, Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    More information...
    The workbook's current state is unshared and unprotected. The macros are not Private, and have no protection according to the VBA project properties I view in Developer/Visual Basic editor.

  3. #3
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    Maybe they are functions; functions don't appear in the macros dialog

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    Maybe the sub are declared Private.
    Or the setting 'Option Private Module' has been used at the top of the module.
    Or the subroutine has arguments.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    05-17-2011
    Location
    Wayzata, Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    They are subroutines, not functions. Also, they appeared in the Macros pull down before I started running the macros.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    In the Macros dialog, there is a 'Macros in:' box - is that set correctly?
    Remember what the dormouse said
    Feed your head

  7. #7
    Registered User
    Join Date
    05-17-2011
    Location
    Wayzata, Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    Andy, they are not declared as Private, nor is 'Option Private Module' used.

  8. #8
    Registered User
    Join Date
    05-17-2011
    Location
    Wayzata, Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    rompstomper,
    Macros in: is set to All Open Workbooks

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    Would save a lot of guessing if you could post example.
    You can remove data and code within the routines if confidential.

  10. #10
    Registered User
    Join Date
    05-17-2011
    Location
    Wayzata, Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    The macros code is:
    -------------------------------
    Public Sub ProtectAllSheets(pswd As String)
    Dim n As Integer
    For n = 1 To ActiveWorkbook.Sheets.Count
    If Not ActiveWorkbook.Sheets(n).ProtectContents Then
    ActiveWorkbook.Sheets(n).Protect Password:=pswd
    ActiveWorkbook.Sheets(n).EnableSelection = xlUnlockedCells
    End If
    Next n
    End Sub
    Sub UnProtectAllSheets(pswd As String)
    Dim n As Integer, admin As Boolean
    admin = Application.Run("'PERSONAL.xlsb'!IsAdmin")
    If admin Then ', param1, param2
    For n = 1 To ActiveWorkbook.Sheets.Count
    ActiveWorkbook.Sheets(n).Unprotect Password:=pswd
    Next n
    Else
    MsgBox ("You do not have the required priveledges for this action.")
    Exit Sub
    End If
    End Sub

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Not exactly what I meant but it shows the problem, which was as I suggested.

    Or the subroutine has arguments.

  12. #12
    Registered User
    Join Date
    05-17-2011
    Location
    Wayzata, Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macros not visible in Developer/Macros, but visible in Developer/VisualBasic

    I couldn't see the forest for the trees!

    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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