+ Reply to Thread
Results 1 to 6 of 6

How to assign RELATIVE macros to a Custom Ribbon

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    Chicago, United States of America
    MS-Off Ver
    Excel 2010
    Posts
    35

    How to assign RELATIVE macros to a Custom Ribbon

    Hello all!

    I currently have an excel workbook (2010) in which I created a custom ribbon and assigned several different macros to teh buttons.

    Long story short, I will be saving several variations of this workbook every so often when I get new data.

    The problem is that if I change the name of the file (Save as or Rename), the custom ribbon buttons no longer work. When I assigned the macros to the ribbon buttons, the macros were absolutly assigned.

    Is it possible to asign relative macros to custom ribbons?



    From research I have done, it appears that custom ribbons cannot be created using VBA. Is this still true? The posts I was reading were from several years back. Has anyone found any alternatives to the above restriction?

    Thanks,

    Grazian2

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to assign RELATIVE macros to a Custom Ribbon

    if you're ok with buttons in the add-ins tab you can still use vba. if you want your own tab you've gotta use xml to change the ribbon-then there is no path assigned and saving the file with new names won't be a problem
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    08-19-2014
    Location
    Pittsburgh, Pennsylvania
    MS-Off Ver
    2010
    Posts
    45

    Re: How to assign RELATIVE macros to a Custom Ribbon

    I don't believe you have provided enough information for a positive solution, but as I believe JosephP eluded to, save the file as .xlam and then activate them as add-ins.
    That way, you can target the procedures from a module in an add-in who's file path does not change.

    Otherwise, when you click your ribbon item, it is looking for a module within a workbook.

    Make sense?

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to assign RELATIVE macros to a Custom Ribbon

    you don't have to save the file as an add-in you just need to use xml to make the ribbon changes inside the file itself

  5. #5
    Registered User
    Join Date
    06-19-2013
    Location
    Chicago, United States of America
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: How to assign RELATIVE macros to a Custom Ribbon

    Hey all!

    Thank you for the responses, I appreciat it.

    @joseph I am okay with a button in the add-ins tab as well. Are you suggesting that I simply need to manually update the ribbon every time the file changes?

    @Jamie.Reis I have not had any experience with .XLAM files, and I will definately give them a shot. Thanks!

    -Grazian2

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to assign RELATIVE macros to a Custom Ribbon

    you can use vba to create the buttons in code when the workbook opens and delete them when it's closed so they always link to the correct file

    if you want to use the ribbon this is a great site: http://www.rondebruin.nl/win/s2/win001.htm

  7. #7
    Registered User
    Join Date
    06-19-2013
    Location
    Chicago, United States of America
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: How to assign RELATIVE macros to a Custom Ribbon

    Thank you for the resource, looks great!

+ 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. [SOLVED] Custom Ribbon not executing macros
    By neddyseagoon in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-15-2019, 01:34 PM
  2. Customize Ribbon (Add Button / Assign Macro) in Excel 2010
    By JMax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2012, 04:46 PM
  3. Custom Ribbon Add-in
    By yawnzzzz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2011, 09:46 AM
  4. Assign a relative macro to a Ribbon Button
    By CaioToOn! in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2011, 05:13 PM
  5. Excel 2007 : Custom Ribbon
    By LB79 in forum Excel General
    Replies: 23
    Last Post: 10-07-2010, 06:27 AM

Tags for this Thread

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