ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can I run a macro in an xla from a button on a sheet (https://www.excelbanter.com/excel-programming/443223-can-i-run-macro-xla-button-sheet.html)

Michael[_51_]

Can I run a macro in an xla from a button on a sheet
 
I want buttons on worksheets in my workbook to run a macro that is
stored in an add-in

I have called the macro 'Public Sub xxx()'

I have created a reference to the add-in in the workbook that will
have the buttons.

But I can't 'see' the macros in the add-in to be able to assign them
to the buttons.

Can I do it?

how?

Cheers

Michael

Peter T[_5_]

Can I run a macro in an xla from a button on a sheet
 
There are two ways to call procedures in other workbooks (incl addins).
First was is to set a reference (tools, References) to the project name (be
sure to have changed from the default VBAProject. But for your needs
probably better to use the Run method (though you won't get any
intellisense)

ret = Application.Run("myAddin.xla!moduleName.ProcName")

you can also include arguments.

Regards,
Peter T


"Michael" wrote in message
...
I want buttons on worksheets in my workbook to run a macro that is
stored in an add-in

I have called the macro 'Public Sub xxx()'

I have created a reference to the add-in in the workbook that will
have the buttons.

But I can't 'see' the macros in the add-in to be able to assign them
to the buttons.

Can I do it?

how?

Cheers

Michael




All times are GMT +1. The time now is 02:53 AM.

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