Closed Thread
Results 1 to 2 of 2

Ribbon buttons use absolute paths for macro assignments

  1. #1
    Registered User
    Join Date
    04-30-2014
    Location
    Goleta, CA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Ribbon buttons use absolute paths for macro assignments

    I am running Excel 2010 and creating macros in VBA. I created custom buttons on the Ribbon and assigned my VBA macros to the buttons using the built-in Customize Ribbon tool (accessed by right-clicking the ribbon and selecting "Customize the Ribbon..." )

    Here is the problem: The VBA macros which are assigned to the ribbon buttons have absolute paths, not relative paths. Therefore, if I change the name of the Excel file, open it, then try to use any of my custom ribbon buttons, I get the error message: "Cannot run the macro <macro name>. The macro may not be available in this workbook or all macros may be disabled." In other words, Excel is looking for the macros in the file with the OLD name, which no longer exists.

    Also, if I move the Excel file to another directory, I get the same error message when pressing any of my custom ribbon buttons. Again, this is because the macro is assigned with an absolute path name, and the file it is looking for does not exist.

    This is easily verified by opening the Customize Ribbon tool. On the left side, the available macros are listed. If I hover the cursor over my macros, a popup balloon shows they are in the currently open Excel file directory. But if I hover the cursor over the assigned macros on the right side of the window, the balloon shows the macros are in the now non-existent file.

    I need to be able to re-name and/or move my Excel file and still have my custom buttons work without re-assigning all of them. Any ideas?

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,604

    Re: Ribbon buttons use absolute paths for macro assignments

    Duplicated

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Mix up of buttons in Excel Add-In ribbon - how to delete buttons?
    By lausianne in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-11-2013, 08:51 AM
  2. Commandbar/Buttons on Ribbon stopped working
    By Reese42 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2012, 12:52 PM
  3. Customizing ribbon with buttons for macros
    By DrNerj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-15-2012, 09:28 AM
  4. How to add buttons to a ribbon - EXCEL 2007
    By avveerkar in forum Excel General
    Replies: 7
    Last Post: 02-16-2011, 03:54 PM
  5. Replies: 0
    Last Post: 04-21-2005, 06:40 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