Results 1 to 4 of 4

Thread: VBE .CommandBars

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Question

    Hi,

    I have this code to create CommandBars in Excel.
    I can give it .Caption = "VBEtest"
    I can give it .OnAction= "VBE_test" --> this is a macro.
    I can give it .ShortcutText= "F2" --> this comes after the caption.

    But, how do I activate those function buttons in VBE ???

    Code:
    Sub CreateCustomMenuBars()
        Dim vntEditArray As Variant
        Dim vntHelpArray As Variant
        Dim vntMenuVar As Variant
        vntEditArray = Array(18, 17, 16, 15, 12, 11, 10, 9, 8)
        vntHelpArray = Array(5, 4)
        With Application.CommandBars("Worksheet Menu Bar")
            .Reset
            For Each vntMenuVar In vntEditArray
                .Controls("Edit").Controls(vntMenuVar).delete
            Next
            .Controls("View").delete
            .Controls("Insert").delete
            .Controls("Format").delete
            .Controls("Tools").delete
            .Controls("Data").delete
            .Controls("Window").delete
            .Controls("File").delete
            .Controls("Edit").delete
            .Controls("help").delete
            With .Controls.Add(msoControlPopup)
                .Caption = "&DEY MODULE"
                With .Controls
                    With .Add(msoControlButton)
                        .Caption = "&About DEY MODULE"
                        .OnAction = "about"
                        .ShortcutText = "F2" 'how do I activate the F2 button ??
                    End With
                    With .Add(msoControlButton)
                        .Caption = "&Reset Menus"
                        .OnAction = "RestoreEnvironment"
                    End With
                    With .Add(msoControlButton)
                        .Caption = "&Show"
                        .OnAction = "Show"
                        .ShortcutText = "F3"
                    End With
    
                    With .Add(msoControlButton)
                        .Caption = "&Quit"
                        .OnAction = "QuitApp"
                    End With
                End With
            End With
        End With
    End Sub

  2. #2
    Addicted Member jcouture100's Avatar
    Join Date
    Aug 1999
    Location
    Omaha, NE. USA
    Posts
    141

    I'm also interested in finding this out.

    If anyone has an answer, I would like to hear about it too.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Unhappy please ...

    Is there anybody out there ...

  4. #4
    Registered User
    Join Date
    Apr 1999
    Location
    Brazil
    Posts
    144

    Question Using Add-in

    Create a new add-in project and take a look in his code, it should help you!

    Jefferson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width