Quick Access toolbar macros may not be available

FireFighter1005

New Member
Joined
Sep 2, 2015
Messages
5
Hi,

I created a set of macros that I need to be able to call whatever the workbook is openned.
For example:

Code:
Public Sub ResetFullLayout()
'**----------------------------------------------------
'**
'**    Purpose: Reset layout to view all columns and all data
'**
'**    Input: none
'**
'**    Ouput: none
'**
    Columns("A:AA").Select
    Selection.EntireColumn.Hidden = False
    Range("L23").Select
    ActiveSheet.ShowAllData
End Sub

Then in order to make accessible with every workbook, I created a macro button in the quick access toolbar.
Which produced the following entry in the qat file:
Code:
[COLOR=#D4D4D4][FONT=Consolas][COLOR=#808080]<[/COLOR][COLOR=#569cd6]mso:button[/COLOR] [COLOR=#9cdcfe]idQ[/COLOR]=[COLOR=#ce9178]"x1:https:__oursharepoint_sites_Shared_Documents_OU_00059_1715_Hierarchy.xlsm_shMain.ResetFullLayout"[/COLOR] [COLOR=#9cdcfe]visible[/COLOR]=[COLOR=#ce9178]"true"[/COLOR] [COLOR=#9cdcfe]label[/COLOR]=[COLOR=#ce9178]"modL6.ClearTable"[/COLOR] [COLOR=#9cdcfe]imageMso[/COLOR]=[COLOR=#ce9178]"ListMacros"[/COLOR] [COLOR=#9cdcfe]onAction[/COLOR]=[COLOR=#ce9178]"https://oursharepoint.com/sites/MainSite/SharedDocuments/OU_00059_1715_Hierarchy.xlsm!shMain.ResetFullLayout"[/COLOR][COLOR=#808080]/>[/COLOR][/FONT][/COLOR]

Normally, I would remove the fully qualified path and keep only the macro name.
It worked in the past.

But while writing this post, I got this idea to reference the module in which the macro would be found.
So I tested it.

I exported the qat file into "Excel Customization.exportedUI", then openned it using VSCode (so I could formet the XML code).
I could find the entry at the end of tag mso:sharedControls<mso:sharedcontrols><mso:sharedcontrols>.
I converted it so it looked like this:
Code:
[COLOR=#D4D4D4][FONT=Consolas][COLOR=#808080]<[/COLOR][COLOR=#569cd6]mso:button[/COLOR] [COLOR=#9cdcfe]idQ[/COLOR]=[COLOR=#ce9178]"x1:ResetFullLayout"[/COLOR] [COLOR=#9cdcfe]visible[/COLOR]=[COLOR=#ce9178]"true"[/COLOR] [COLOR=#9cdcfe]label[/COLOR]=[COLOR=#ce9178]"ResetFullLayout"[/COLOR] [COLOR=#9cdcfe]imageMso[/COLOR]=[COLOR=#ce9178]"ListMacros"[/COLOR] [COLOR=#9cdcfe]onAction[/COLOR]=[COLOR=#ce9178]"shMain.ResetFullLayout"[/COLOR][COLOR=#808080]/>[/COLOR][/FONT][/COLOR]

I tried it in the curent workbook and it worked!

Even though I know this forums is meant to ask questions, I though it would be nice to provide the answer since I found it.
In case anybody else runs into the same issue.

Feel free to get rid of this post if moderators find it uselss or a duplicate of some other post. (sorry I did search but I couldn't find anything related to this issue)</mso:sharedcontrols></mso:sharedcontrols>
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top