How does one do this?
I only ask because I have a macro that will only execute if the template is located in a certain directory. If I move it, I have to reassign the macro.
I was hoping there would be a way, preferably through VBA, to assign this macro dynamically.
Thanks,
meherts
Well, I came up with a solution. If anyone has a better solution, feel free to post it!
Regards,Code:Application.CommandBars(" ... ").Controls.Items( ... ).OnAction = ThisWorkbook.FullName & " ... "
meherts
Last edited by romperstomper; 09-02-2010 at 05:19 PM. Reason: tags
In the Tools -> Options under "Quick Access Toolbar"
I have a dropdown that shows my Macros. I can add any of my module macors to the QAT.
I don't know where to find this in Excel 2003. Any help here?
@MarvinP
I wanted to avoid having to manually set the macros, which the code I provided enabled me to do. As for your problem, it'll probably stand a better chance if you started a separate thread. Regardless, good luck!
Regards,
meherts
Safer to use:
in case the workbook name has spaces in it.Code:Application.CommandBars(" ... ").Controls.Items( ... ).OnAction = "'" & ThisWorkbook.FullName & "'!macro_name_here"
So long, and thanks for all the fish.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks