Consulting

Results 1 to 4 of 4

Thread: Solved: Excel 2003 Workbook Open Code

  1. #1

    Solved: Excel 2003 Workbook Open Code

    I have Some code written in a project that creates a Custom Toolbar, Places a Custom button on it, Assigns a macro to it and it works just fine.

    However, I can't for the life of me figure out how to:

    1. Make the button only show it's text name instead of the smiley face

    2. Dock the toolbar

    Is this possible? And if so help would be greatly appreciated.

    Thanks,

    MWGainesJr

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Welcome to VBAX!

    Would you care to show us the code you are using to create this itme so we can better help you with your query?
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    Quote Originally Posted by Simon Lloyd
    Welcome to VBAX!

    Would you care to show us the code you are using to create this itme so we can better help you with your query?
    [VBA]Private Sub Workbook_Open()
    Dim ClassOf2010 As CommandBar
    Dim Internship_1 As CommandBarButton
    Set ClassOf2010 = Application.CommandBars.Add
    With ClassOf2010
    .Name = "Class of 2010"
    .Position = msoBarLeft
    .Visible = True
    Set Internship_1 = .Controls.Add(msoControlButton)
    End With
    With Internship_1
    .OnAction = "Show_Internship_1"
    .Caption = "Internship 1"
    End With
    End Sub[/VBA]

    I've got it docked now but I still need the button to have a label. I've managed to take the Smiley away but right now it is just a blank space on the bar that can be clicked. I'd like to show its text caption.

    Thanks for the help.

  4. #4
    Quote Originally Posted by Simon Lloyd
    Welcome to VBAX!

    Would you care to show us the code you are using to create this itme so we can better help you with your query?
    Nevermind. I figured it out.

    [VBA].style = msobuttoncaption[/VBA]

    Thanks for your help though guys. I'll be sure to come back here from now on for help.

Posting Permissions

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