+ Reply to Thread
Results 1 to 6 of 6

Custom Toolbars macro always refers to new saved filename

  1. #1
    Registered User
    Join Date
    03-09-2007
    Posts
    75

    Custom Toolbars macro always refers to new saved filename

    Hi all,

    I have the following situation. I have created my macros (some in module, some in individual worksheets so that I can fire the macro with events and some in Thisworkbook so that I can control printout event)

    Then I use the custom toolbar to build a basic toolbar with all the required macros and attached it to the file so that any users can also use the toolbar. However, this custom toolbar is set to be invisible when switch to other workbooks (set this in thisworkbook).

    Now, here comes the problem. Whenever I save the next version or even a new file name, the macros in the custom toolbar will automatically refers to new filename macros. Hence, all those macros in the custom toolbars that refers to macros in individual worksheets will not fire for the older file version or filename.

    I need this to be "universal" as this is the master template and users will start to save new filename and even add versions to the same file name. It will not be a problem if they keep using the newest file but if they were to go back and use the older version, they will have problem of not firing the events.

    Lastly, I have also tried using
    set abc = worksheets("def")
    but there are some code that uses
    range("a1").select
    selection."the required function"
    and it is always at this point of time, the macro will have problem. I have also tried moving all macros out to module and using the above to refer codes back to individual worksheets that they need to be fired upon, but alas, all failed.

    Please kindly advice a way which I could use a macro to let the custom toolbar to be always using the macro within this workbook or this filename.

    Thanks in advance and sorry for the long explanation.

    Cheers,
    CL

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Create the toolbaar using code, there are examples on the Forum - I have posted some. Do a search & post back for specific help.
    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-09-2007
    Posts
    75
    Hi Roy,

    I will try to do a search and post again if I have encounter any queries.

    Cheers,
    CL

  4. #4
    Registered User
    Join Date
    03-09-2007
    Posts
    75
    Hi Roy,

    I had searched your previous posts and the menu macro is good. But I would prefer that the users fire the event from toolbar. And from the threads with your posting, I found the macro to store toolbar in VBA rather fitting to my requirements.

    Hence, I started using Contextures - http://www.contextures.com/xlToolbar02.html - and amended the code to store it in Thisworkbook and fire it only in my template and not other files.

    Thank you once again.

    Cheers,
    CL

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The coide I posted created menus via the THisWorkBook mudule, similar to what you have found at Contextures.

  6. #6
    Registered User
    Join Date
    03-09-2007
    Posts
    75
    Hi Roy,

    Thanks for all the help. I am also looking at the attachment in the thread and thus, I was saying that I find the posting of codes in the menu (as in your attachment, not appropriate for quick firing of codes.

    See ya around as I am still learning VBA and looking forward to your help anytime.

    Cheers,
    CL

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Make Called Macro End the First Macro
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2007, 11:38 AM
  2. Custom h:mm formatting Macro help
    By Ralfie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-20-2007, 05:55 PM
  3. How to disable macro in saved file
    By wmjenner in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-07-2007, 03:01 PM
  4. Problem with custom toolbars
    By Willow in forum Excel General
    Replies: 0
    Last Post: 10-03-2006, 09:31 AM
  5. Help with a Macro (MS Word)
    By Push Latency in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2006, 01:37 PM

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