+ Reply to Thread
Results 1 to 7 of 7

Attaching a Custom Toolbar to Workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    03-13-2009
    Location
    Defiance, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    21

    Attaching a Custom Toolbar to Workbook

    I have created a workbook and made a custom toolbar to perform the macro functions for the sheets in the workbook. Everything works great for me, but I want to attach the custom toolbar to the workbook so that whenever someone else pulls up the workbook they pull up the custom toolbar too.

    I used the tools menu, clicked customize, toolbars, attach, selected the custom toolbar and clicked copy.

    No toolbar appears.

    I can select View, Toolbars, and select the custom toolbar, then the toolbar appears, but when I close the sheet the toolbar remains.

    When someone else opens the sheet, the toolbar appears without any "buttons." It is an empty toolbar.

    The help text isn't helping because the instructions for attaching a custom toolbar to a worksheet (tools/customize/toolbars/attach/copy) do not attach the toolbar to the workbook.

    So obviously I'm missing something.

    What do I do? Thanks.

    Mogadeet
    Last edited by Mogadeet; 04-16-2009 at 02:32 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Attaching a Custom Toolbar to Workbook

    The best way is to create the toolbar using code, see this earlier post
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-13-2009
    Location
    Defiance, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Attaching a Custom Toolbar to Workbook

    That post sounds somewhat like instructions for creating a toolbar in a version of Xcel that does not normally have toolbars (and it's not very clear).

    The version I have, Microsoft Office Xcel 2003, uses toolbars and you can create them. Supposedly you can attach them to workbooks too. At least the help text says you can.

    I have created the toolbar and it is sticking doggedly to my program, but obviously not to the sheet despite performing the necessary tasks to make it so.

    Would code designed for a non-toolbar providing version of Xcel be compatible with a toolbar providing version? And I didn't see anything that would indicate that I can edit it so it is custom.

    Thanks

    Mogadeet

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Attaching a Custom Toolbar to Workbook

    Here's a workbook that contains example code to create a menu called My Menu with sub menus.

    Note the WorkBook_Open event which calls the create menu code & very important the WorKBook_BeforeClose which removes the menu when the workbook is closed
    Attached Files Attached Files

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Attaching a Custom Toolbar to Workbook

    The code is to add a menu to Excel, it will work in Excel 2003. Try the code in a dummy workbook.

    As I said adding the toolbar with such code is the most effective way.

  6. #6
    Registered User
    Join Date
    03-13-2009
    Location
    Defiance, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Attaching a Custom Toolbar to Workbook

    I have downloaded your example and run it, and though it is creating a menu rather than a toolbar, it is a nice thing and I like it.
    So, I copied it and pasted it into the sheet I am working on to see what it would do. I pasted it as Module 2 (adding a module), so it wouldn't mess with my other Macros which are in Module 1.

    The menu would not appear when I opened the sheet. It would not run on opening even though I tried shutting down Xcel and starting it again. Should I reboot first?

    When I selected "Run Macro" it appeared and operated flawlessly, but remained when I closed the sheet.

    So, when pasted into my sheet it does not start up on its own and does not stop on its own. No code was changed or altered from your example sheet.

    What am I doing wrong?

    Mogadeet
    Attached Files Attached Files

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Attaching a Custom Toolbar to Workbook

    You haven't used the code in the workbook_open event to install the menu, nor the code in the Before_Close event to delete the menu.

    I'll add a toolbar example.

    Not really part of the question, but looking at your main code I would suggest you take a little time to "clean" it up. You can remove all those small scrolls to start.
    Attached Files Attached Files
    Last edited by royUK; 04-15-2009 at 01:28 PM.

+ 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