Excel Daily News

Search MrExcel

Can I add a button from XLStart\Personal.xls?

I have a macro I've attached to a custom button in Excel, but I want to distribute this macro to co-workers.

I would like the macro to add the button to Excel on their PCs so I don't have to go around to everyones desk and do it manually. Is this possible?

Thanks in advance!!David

Posted by Paul E. on May 11, 2001 11:32 AM

Hi David,I've been working on the same thing. One suggestion that I have, would be to save the macro as an *.xla (add-in file), and have your associates save it in their Microsoft Office Library directory. That way they can select the add-in from the addins dialog box, and load it into Excel, when needed. But first you need to create a toolbar (containing a button referencing your macro) that automatically loads when this add-in is selected.

Below are two subroutines that you can put into your VBA code and reference from the Workbooks_Open and Workbook_BeforeClose subs. Calling the first subroutine from the Workbook_Open sub in your *.xla file, will automatically create the toolbar and a button which references the macro you which to execute. The second subroutine erases the toolbar when the add-in is deselected fromt he add-in dialog box.

Call this subroutine from the Workbooks_Open sub'''''''''''''''''''''''''''''''''''''''Private Const CBR_INSERT As String = "Place your toolbar name here"Private Const CTL_INSERT As String = "Place a name for the button here"

(12 responses) HI! I am using a vlookup/match to populate fields from column headers. For the most part it's doing exactly what I need except instead of pu

Let's Connect

MrExcel.com debuted on November 21, 1998.

MrExcel.com provides examples of Formulas, Functions and Visual Basic procedures
for illustration only, without warranty either expressed or implied, including
but not limited to the implied warranties of merchantability and/or fitness for
a particular purpose. The Formulas, Functions and Visual Basic procedures on this
web site are provided "as is" and we do not guarantee that they can be used in all
situations.
This site contains affiliate links. Any affiliate commissions that we
earn when you click a link to Amazon or other sites is reinvested in keeping MrExcel.com
running. You can earn a commission for sales leads that you send to us by joining our
affiliate program.
View our Privacy Policy, Cookies Policy, and Terms of Use.