Search code examples
excelribbonx

How to open an external Excel macro file as read-only using a ribbon button?


I've got an Excel add-in file (.xlam) stored in a shared location, and a bunch of custom Ribbon buttons linking to the macros in that file. When user clicks on the button, the add-in is opened for them, and the macro from that add-in runs. There are many users of that add-in, and they constantly have Excel open, so when I need to make an update to the add-in, I have to ask everyone to close all Excel files and wait for me to complete the update. Therefore, I'm wondering if it's possible to always make the add-in open as read-only when called from the Ribbon?


Solution

  • Not exactly answering the question in the header, but I solved my problem, and maybe someone finds it useful as well.

    Solution is very simple: right click on the .xlam file in question, select "Properties" and tick "Read-Only". It will always open as read-only, not just when called from Ribbon, but you can make changes to the file by saving it in another location, and then replacing the original file.