sharky
sharky

Reputation: 327

UI for creating a custom tab in ribbons for an add in for Excel for Mac

Is there any other simple way apart from using the Custom UI Editor as mentioned here? I've tried this method. It works fine for Excel on Windows but simply does not load anything on a Mac.

Upvotes: 0

Views: 4055

Answers (2)

julianm
julianm

Reputation: 879

I know a workaround, but you need to be able to edit the VBA Code in Windows first and save your Macro-enabled .xlsm spreadsheet as a .xlam file. To create the ribbon, the method relies on a 3rd party software called Office Ribbon Editor. Then, go to your Mac computer and install the addin from Tools -> Addins menu.

Part A: Create a custom Ribbon tab for Microsoft Excel in Windows

Here are the detailed steps:

  1. Install Office Ribbon Editor. You'd need to download the latest .NET Framework pack during the install process.

  2. Once installed, use Run as Administrator to open the Office Ribbon Editor.

  3. Create a new Excel 2010 Spreadsheet.

Create a New Excel worksheet add-in

Here, you'll need to specify the output file. Choose Excel Macro Enabled Workbook (*.xlsm)

Save Macro-enabled Excel file

  1. Add a Custom UI for Office 2010 using Document Explorer pane (at the right).

Add a custom UI

  1. Use the following code template for the Custom UI content. Edit accordingly.

code snippet:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
    <tabs>
        <tab id="excelTab" label="FPPT">
            <group id="groupExport" label="Export">
              <button id="btnExportJPG" label="Export JPG" imageMso="ExportHtmlDocument" size="large" onAction="ExportImages" />
            </group>
<group id="groupOptions" label="Options">
                <button id="btnAbout" label="About" imageMso="FunctionsLogicalInsertGallery" size="large" onAction="About" />
            </group>
        </tab>
    </tabs>
  </ribbon>
</customUI>
  1. Save the changes and close the application.

  2. Now, open the .xlsm file using Microsoft Excel for Windows.

  3. Enable the Developers tab in the Ribbon.

  4. Click VBA Code to view the source code and add a new Module. Then, create a Sub that will be executed when the user clicks the button. For the code I specified above, you'd need to create Sub ExportImages().

  5. Finally, close the VBA editor and click File -> Save As to save your spreadsheet as an Excel Add-in (*.xlam).

Part B: Install the add-in on Mac

  1. Go to your Mac and open Microsoft Excel for Mac.

  2. Go to Tools -> Add-ins and browse for the xlam file you created using Windows.

Once the add-in is enabled you should be able to see the custom UI tab in the Ribbon.

Custom Ribbon in Excel for Mac

Misc:

The process also works for other Microsoft Office programs: Excel, PowerPoint and Word. I didn't test the approach for Outlook add-ins.

In fact, I have used this approach to make an add-in for Mac and Windows that exports all the presentation slides in PowerPoint to JPG images, with a single click. This helped me to save valuable time (for years) while uploading the free PowerPoint templates to my site.

Upvotes: 3

Eugene Astafiev
Eugene Astafiev

Reputation: 49453

Firstly, Office for Mac doesn't support COM add-ins. The COM technology lives on Windows only. Instead, you may consider developing an Office App. See Office Add-ins for more information. Note, at the #build2015 MS called Office Apps as add-ins. Anyway, you can't customize the Fluent UI using Apps/add-ins.

Upvotes: 0

Related Questions