How do I share a VBA excel function within a team - excel

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.

Related

CustomUI ribbon customization disappears on save?

I've created an Excel workbook for a client of mine which uses a custom ribbon tab to access the VBA functionality. It thus contains a customUI.xml file with the extra ribbon code in it (by using the Custom UI Editor tool). By now, all was working well for over a year.
However, a few days ago the ribbon customizations keep disappearing after he makes a simple modification to the file and saves it again. Nothing fancy; just change some cell values and ctrl-s save. When opening the saved version the ribbon doesn't show up, and on closer inspection it turns out the ribbon customization is completely gone from the file at that point (the entire root customUI folder is gone and the reference to it from the _rels.rels file is gone too). He's just a regular Excel user, so he doesn't even know about Office custom UI ribbon xmls etc, so it's not that he has been messing with tools he shouldn't have messed with. When I open a working copy of the file on my machine and save it, the ribbon remains in place.
The VBA is still intact though, and the listobject tables that are placed on some sheets are still there too, so it can't be because it got intermediately saved in 2003 format or such...
The file does live in a Sharepoint and OneDrive environment, but IIRC he also had this problem when retrieving a working backup of the file, placing it on his desktop and making a modification from there. Then again a few months ago his IT administrator has moved his company over to Office 356 and migrated his files to the cloud, so it might well be his desktop is on OneDrive too.
What could cause a perfectly fine ribbon to disappear like that? A rogue Office update? Or some Sharepoint 'security' feature to remove ribbons on save? (note that I'm not well known with Sharepoint so this is just wild speculation.) He's using Office 365, so I presume he's on Excel 2019 (as am I).
All leads are welcome, because I'm at a total loss here...

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.

Turning Custom Ribbon Tab into Add-In

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.

Recovering datas from an Excel/ActiveX spreadsheet

I'm having the following issue: I've an Excel spreadsheet with a lot of VBA codes and ActiveX controls, including RExcel formulas.
The Excel version is 2007.
When I try to open this file, Task Manager says Excel isn't answering and something starts like if Excel started running endless codes; I deactivated each control and it still seems broken.
I would like to recover at least some formulas I've written in that spreadsheet, but this is actually impossible by opening the spreadsheet in conventional way.
Could you tell me how I can "read" formulas and text in that spreadsheet without opening it by Excel?
Thanks,
Indeed have calculation set to manual for a start.
Now set your security settings such that macros and activeX are disabled:
Excel Options > Trust Center > Trust Center Settings... > Macro Settings > Disable all macros with notification
For ActiveX I am not sure if there is a menu in excel-2007 like for macros, but if there is make sure it is set to not run as well.
Now you can open your excel workbook and it will not run your macro's and shouldn't auto calculate or update!
ADDED: I have had something like this in the past and this is what worked in 1 occasion: install an other office excel application, like open office (the calc application has the excel functionality) and see if it opens in that application. Then if it does, save the file (under another file name) and close it. Open the new file under MS Office Excel, and see what is still recoverable.
Good luck!
use a tool like 7zip to extract the files. the sheets/formulas are in the .xml
the code in a macro enabled spreadsheet is in a .bin file
this can be read with MalOfficeScanner

How can I make an Excel Sheet forget that it was generated from TFS?

I have an Excel sheet which is generated by opening the result from some query based on TFS work items.
I'm using this Excel for my personal planning, but whenever I close the Sheet, it asks me if I want to publish my changes to TFS.
I want it to completely forget that it is derived from TFS, because I fear that some day I may publish my changes unintentionally.
I have tried saving the Excel Document in the oldest possible Excel format, but that doesn't help.
This is much easier than the other solutions on offer:
Click on a cell in the table
Open the Table Design tab on the ribbon
Click "Convert table to range"
Save the workbook
Done!
Disclaimer: I've only tried it with TFS 2012 & Office 2010.
You can copy the list and paste it into another Excel workbook.
There is a procedure that describes how to do this at this Microsoft blog, provided by Dennis Habib:
"Close Excel. Disable the TFS addin by going to HKLM\Software\Microsoft\Office\Excel\Addins\TfcOfficeShim.Connect and change the ‘LoadBehavior’ from ‘3’ to ‘0’. Open the .xls file. Wipe out the contents of the custom document properties (File -> Properties -> Custom). Save the file and exit Excel. Re-enable the TFS addin."

Resources