ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macros from Add-in? (https://www.excelbanter.com/excel-programming/333866-macros-add.html)

davegb

Macros from Add-in?
 
I want to put a number of macros and a datasheet I use when I'm doing a
particular task in an Add-in. I did as Walkenbach's book instructed,
created a spreadsheet and put the macros in the spreadsheet with a
toolbar to access the macros, then saved the spreadsheet as an Add-in.
But when I click on the buttons, they open the spreadsheet to access
the macros, not the Add-in (which I installed in the Tools, Add-ins
window. I tried reassiging the macros to the Add-in, but as promised,
the macros from the Add-in don't show in the macros box. How do I get
the macro buttons to access the macros in the add-in?


STEVE BELL

Macros from Add-in?
 
Without a sample of your code - it is hard to say.

But here's a sample of code I use in Excel 2000

With .Controls.Add(Type:=msoControlButton)
.BeginGroup = True
.Caption = "Do My Thing"
.Style = msoButtonCaption
.OnAction = "YourCodeName"
End With


"YourCodeName" refers to the name of a macro in a standard module
in your workbook or addin...


--
steveB

Remove "AYN" from email to respond
"davegb" wrote in message
ups.com...
I want to put a number of macros and a datasheet I use when I'm doing a
particular task in an Add-in. I did as Walkenbach's book instructed,
created a spreadsheet and put the macros in the spreadsheet with a
toolbar to access the macros, then saved the spreadsheet as an Add-in.
But when I click on the buttons, they open the spreadsheet to access
the macros, not the Add-in (which I installed in the Tools, Add-ins
window. I tried reassiging the macros to the Add-in, but as promised,
the macros from the Add-in don't show in the macros box. How do I get
the macro buttons to access the macros in the add-in?





All times are GMT +1. The time now is 07:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com