fluorophore
New Member
- Joined
- Mar 27, 2013
- Messages
- 3
I have four macros I would like to call within Excel 2010. They all run fine when called using a command button. In order to have accessing them more convenient (in any worksheet), I wanted to create a custom ribbon tab that has buttons to run each. This also works fine, however I need to have this functionality available to anyone that I send the spreadsheet to.
If I export the ribbon information using "export all customizations," which creates a *.exportedUI file, and then import this on a different machine, the ribbon appears fine, however clicking on one of the macro buttons in the ribbon gives the error:
The reason why it's not working is clear: this isn't the path of the current file. For whatever reason, the macro path it tries to access is that of the original file when the ribbon was first created and exported.
It seems odd that the default is to specify the macro location to be the original path rather to just point to wherever the current file resides (since the macros are already embedded there). I have no idea how to fix this, but it should be simple.
I've searched a fair amount on this topic, and there are solutions out there, but I don't see how to apply them to my situation. For example, someone suggests adding this code fixes it:
The trouble is that this would have to be in a location where the macro is called, and that only occurs in the ribbon. I don't call macros from within VBA code.</c:\users...\filename.xlsm'!macro1'.>
If I export the ribbon information using "export all customizations," which creates a *.exportedUI file, and then import this on a different machine, the ribbon appears fine, however clicking on one of the macro buttons in the ribbon gives the error:
<c:\users...\filename.xlsm'!macro1'. the="" macro="" may="" not="" be="" available="" in="" this="" workbook="" or="" all="" macros="" disabled.Cannot run the macro "C:\Users\ ... \filename.xlsm'!macro1'. The macro may not be available in this workbook or all macros may be disabled.
The reason why it's not working is clear: this isn't the path of the current file. For whatever reason, the macro path it tries to access is that of the original file when the ribbon was first created and exported.
It seems odd that the default is to specify the macro location to be the original path rather to just point to wherever the current file resides (since the macros are already embedded there). I have no idea how to fix this, but it should be simple.
I've searched a fair amount on this topic, and there are solutions out there, but I don't see how to apply them to my situation. For example, someone suggests adding this code fixes it:
Code:
[COLOR=#333333]Application.Run "'" & Application.ActiveWorkbook.Name & "'!NamShortList"[/COLOR]
The trouble is that this would have to be in a location where the macro is called, and that only occurs in the ribbon. I don't call macros from within VBA code.</c:\users...\filename.xlsm'!macro1'.>
Last edited: