Turning Custom Ribbon Tab into Add-In - excel

I am trying to turn a custom ribbon button I made into an add-in that others can use for any worksheet in Excel. I followed this StackExchange post on making a custom ribbon tab to make the ribbon button, and I have it successfully working within one workbook (one Excel Macro Enabled file).
How can I export the ribbon tab XML along with the VBA callback module so another user can use this in their Excel installation?
Thanks!

There are a few ways to do it. The simplest one is to put your .xlsm file in a known start-up folder like XLSTART.
To find the folders' location, in Excel:
Go to File > Options > Trust Center
Click Trust Center Settings...
Go to Trusted Locations
Put your file in one of the listed XLSTART or STARTUP locations.
The locations look something like this C:\Program Files\Microsoft Office\Root\Office<XX>\XLSTART\ for the whole computer, or like C:\Users\<User>\AppData\Roaming\Microsoft\Excel\XLSTART\ for the user.
When you restart Excel the file should be loaded automatically.
In addition: Saving your file as a .xlam will also make it behave as an add-in, and will not show the worksheet. You can find some information about the file type choice here Excel: Book or Addin.

Related

How to open an Excel Online document as a PDF

We have an Excel Online file that I'd like to link to, but as a pdf. In other words, I want a link that opens the contents of the Excel Online file as a PDF file. Ideally, admin users would be able to edit the excel file, then end-users would be able to open the PDF version of that file, as it is continuously updated by the admin users. Is this possible? I would need a link to the PDF version of the file.
I did come across this thread, but the answer isn't actually answering the question. https://superuser.com/questions/1133384/is-it-possible-to-link-or-sync-an-excel-spreadsheet-with-a-pdf
Based on your response above I believe the following may accomplish what you want.
What you will need to do is enable the Developer Tab in Excel so we can create Macros. We will be creating a Macro that will Save the excel file as a PDF. My assumption is that there is one worksheet in the excel file. When you enable the macros, and save the first time it you will need to save it as a xlsm file to save the macros with the file. Once you do this perform the following below.
In Onedrive create a new folder and call it "MyPubDocs" for example.
In Excel open up your online Xlsm file and do a SaveAs
In the file dialog Box navigate to the Onedrive folder you created and take note of the folder name. It might show...
Web Sites > https://d.docs.live.net > > MyPubDocs
Click on the header bar and copy the URL and save it.
In Excel go to the developer Tab, if you don't see then go to File Menu -> Options -> Customize RIbbons -> Popular Commands (left) and Main Tabs (right) and check the Developer checkbox. click OK.
Click on Macro Button Set the Macro name to "SaveToOneDrive" ad click create.
That should open a IDE where you will paste the following command.
ActiveWorkbook.SaveAs Filename:="https://d.docs.live.net/XXXXXXXXXXXXXX/MyPubDocs/" & "MyExcelFileExportAsPDF.Pdf"
When creating the macro you should be able to assign a hotkey to that macro.
Now whenever the admin finishes saving the excel file, they can press the hotkey or run the macro and it will save the file to the location.
If you want to associate the macro to the save event of the workbook, you can, but auto save should be turned off.
After the first time you saved the pdf, go to onedirve and navigate to the pdf file. Create a sharable link that you can distribute to your users. When they navigate to that sharable link it should show them the most recent pdf.
HTH

Is there a way to share a Excel VB Macro as a tool for all future workbooks?

I made a VB script that re-formats data exported to excel from a website so that it is compatible with a geocoder. As of now every export I have to go in, past the VB code run it and save the changes. I am wondering if there is a way to make the VB code available as a tool for all workbooks so it is just a matter of opening the xls file clicking a button and saving it?
To expand a little on BigBen's comment:
Open the Excel file with your code in. Open a new blank Workbook. Open up the VBA Editor (Alt-F11).
Drag the module which contains your code to the new workbook (in the left-hand navigator pane). You should see it add to this new Workbook.
Save you new workbook as MyFunctions (or whatever name you fancy) but choose the "Excel Add-in (*.xlam)" file type. You should see a new file appear in your folder as MyFunctions.xlam.
Back in Excel, from the File menu, choose Options (right at the bottom). And then Add-Ins from the left-hand list. At the bottom will be a drop-down box "Manage: Excel Add Ins". Hit Go...
You'll a list of the add-ins that your Excel knows about: some will be checked (that is they will be loaded at start-up) and some not.
Choose Browse, and navigate to wherever you saved MyFunctions.xlam. And double click on it. You may get a security warning (as your addin doesnt have a digital signature) but just go ahead and enable it (as you wrote the code: this is not blanket advice!). Close Excel (this remembers your choices).
When you next open Excel you should see your add-in file open in the VBA Editor, and your macros and UDFs available in whatever worksheet you are using.

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?
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.

How do I share a VBA excel function within a team

I've written my first VBA Excel function, ConvertFromUSD(amount,currencyname,year), which uses an excel spreadsheet to look up an exchange rate from US Dollars to a specified currency for a specified year, and returns the converted sum.
It seems to work fine, and I've made it into an Add-in that I can use whenever I start a new spreadsheet or edit an existing one.
Now I want to make this add-in available to a couple of dozen other people in my team, but I can't see how to do it; should I send the .xla to each of them and get them to install it (if so, how?), or can I put it somewhere where their excel applications will automagically find it?
Thanks for your help.
If they just double click the .xla file it should work for them. It will probably disappear as soon as they close excel though.
The quick way to get it to stick around:
enable their "Developer"
tab
Navigate to the Developer tab
Click "Add-ins"
"Browse" to the .xla file
Ensure that it's "Checked" in the list
There is a folder where they will be displayed in the "Add-in" dialog automatically without browsing, but it depends on the version of excel. 2010, for instance, is C:\Program Files\Microsoft Office\Office14\Library.

What is the easiest way to add Macro automatically to a set of Excel Files

I have a macro function that I have added to an excel file. My question is how can I add the same macro function to a specific set of excel files without copy pasting the macro in each excel vba editor.What is the easiest way to achieve this?
The objective is for the users who have no knowledge on excel macros should be able to easily add Macros to excel and execute it.
If the people who are importing the macros are also the users of these macros you might want to create an add-in out of your vba macro. The procedure is described here. The users would just have to install the add-in on their PCs once(step 4). They can then use the add-in for several Excel-files.
This needs to be done by each user once:
Step 4: Install the Add-In:
Go to Tools > Add-Ins to open the Add-Ins dialog. If you have stored your Add-In in the default location you will see its name displayed in the Add-Ins available: window (if you have stored your Add-In in a different folder, use the [Browse] button to find it). Click on your Add-In's name to see its description at the bottom of the dialog box.
To install your Add-In place a tick in the check-box next to your Add-In's name and click [OK]. [Click the thumbnail below to see a full-sized image]...
Installing your Add-In (Excel 2002) Installing your Add-In (Excel 2000/97)
As soon as the Add-In is installed its functions will be available in Excel. Find them in the User Defined section of the Function Wizard (Paste Function Tool) or simply type them into a cell as you would any built-in function. The Add-In will remain installed until you return to the Add-Ins dialog and uninstall it by removing the tick from the check-box.

Resources