MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Link XLA macros to XLB buttons

Posted by Feargal Tierney on December 04, 2000 4:12 AM


I've created some macros and stored them in an XLA, when i 'add' this (as an addin) i cannot 'see' the macros contained within it. How then can i make the buttons created on my new (XLB) toolbar run portions of these macros.
As a background during development i kept all in the personal.xls book, now though i wish to deploy in a more secure method - hence using an add-in.

Any thoughts peeps would put you firmly on my christmas card list (near the top to!)


Posted by Andy A on December 04, 2000 8:42 AM

You could assign the buttons normally to macros in the worksheet, but inside those macros place a call to your addin e.g. something like

Sub MyButton_Click
Dim iA As Integer
iA = Application.Run("MyAddin.xla!MyAddinSub", Myparameters)
End Sub