Add Ribbon Shortcut Icon To Call VBA Macro In Document level
Overview
Just add an xml file for a new tab containing a button and register the xml file in the .rels xml file inside the Excel file.
Document Link
learn.microsoft.com::Customize the Office Fluent ribbon by using an Open XML formats file
Additional Description
I’m not sure if it’s because it’s a Korean document, but when I specified the function name in xml as ThisDocument.SomeFunctionName
, it was not called.
It worked After I added a module to the document as shown below and called the function name of the module directly.
It was an Excel file I created a few years ago to automate tasks, but I couldn’t remember how I added the buttons, so I had to spend some time. I’m leaving a note for your future self.
I considered using Visual Studio Tools for Office, but I thought it would complicate security-related issues, so I wanted to use a simpler method.
I think that my future self will probably want to see the following again.