Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Custom Toolbars - STILL not sticking

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    232
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi, I posted a question a few days ago about getting custom toolbars to stick to workbooks when they are emailed out to different people.

    I was advised to go and attach the toolbar, which I did, but it still isn't sticking when emailed to users, and doesn't appear in their custom toolbar list either.

    Is there some code I could include to make the toolbar be there for everyone?

    Cheers
    Matt

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    You can create toolbars 'on-the-fly' in VBA. Something like this should get you going. It's copied directly from a simple add-in I wrote:-

    Code:
    Private Sub Workbook_Open()
    'Attempt to delete any menu just in case Excel was
    'closed down improperly or crashed.
    Dim Con As CommandBarControl, ConPop As CommandBarPopup
    Dim ComBut As CommandBarButton
    For Each Con In Application.CommandBars("Tools").Controls
        If Con.Caption = "C&lean Active Workbook" Then
            Con.Delete
        End If
    Next
    
    Set ComBut = Application.CommandBars("Tools").Controls.Add(msoControlButton)
    ComBut.Caption = "C&lean Active Workbook"
    ComBut.OnAction = "CleanBook"
    ComBut.FaceId = 59
    
    End Sub
    HTH,
    D

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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