+ Reply to Thread
Results 1 to 2 of 2

Creating Toolbar Buttons

Hybrid View

  1. #1
    Registered User
    Join Date
    05-22-2009
    Location
    Shirland, IL
    MS-Off Ver
    Excel '00 & '03
    Posts
    51

    Creating Toolbar Buttons

    Hey all,

    The code I have below creates about 5 toolbar buttons for me and they work great. What i would like to know is if it is possible to have the button be text only, no Icon?

    Sheets("Sheet1").Select
    For Index = 1 To Toolbars.Count
        Compare = Toolbars(Index).Name
        If Compare = "Master Standards" Then
            MsgBox "Master Standards needs to have a toolbar by the name ""Master Standards"" and one already appears to exist. When you click Ok the existing toolbar by that name will be deleted and you will have to generate it again later. Sorry for the inconvenience."
            Toolbars("Master Standards").Delete
            With Application
                .ShowToolTips = True
                .LargeButtons = False
                .ColorButtons = True
            End With
        End If
    Next Index
    If ActiveWorkbook.ReadOnly Then
    Sheets("Sheet1").Select
        For Index = 1 To Toolbars.Count
            Range("a" & (Index)).value = "Toolbars(" & Index & ")"
            Range("b" & (Index)).value = Toolbars(Index).Visible
            Toolbars(Index).Visible = False
        Next Index
        Toolbars.Add ("Master Standards")
        With Toolbars("Master Standards")
            .Visible = True
            .Position = xlTop
            .Left = 310
            .Top = 15
        End With
        With Application
            .ShowToolTips = True
            .LargeButtons = False
            .ColorButtons = True
        End With
    Else: Exit Sub
    End If
    Toolbars("Master Standards").ToolbarButtons.Add 211, 1, "GOTO_Main", , True, "Going to Main Menu", , "Main Menu"
    Toolbars("Master Standards").ToolbarButtons.Add 212, 2, "Save_Current_Work", , True, "Saving", , "Save Document"
    Toolbars("Master Standards").ToolbarButtons.Add 210, 3, "GOTO_Machine_Information", , True, "Going to Machine Information", , "Machine Information"
    Toolbars("Master Standards").ToolbarButtons.Add 209, 4, "GOTO_Master_Customer_Estimate", , True, "Going to Master Customer Estimate", , "Master Customer Estimate"
    Toolbars("Master Standards").ToolbarButtons.Add 206, 5, "Contact_Help", , True, "All our operators are busy at the moment, please hold", , "Contact Help"
    Sheets("Main").Select
    If you could help me out that would be great. thanks!

  2. #2
    Forum Contributor
    Join Date
    05-05-2009
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010 and 365
    Posts
    113

    Re: Creating Toolbar Buttons

    I'm not sure if it will work in 2000 but in 2003, the button control has a .Style property which can be set to the constant msoButtonCaption.

+ 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