Can I run a macro in an xla from a button on a sheet

M

Michael

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
 
P

Peter T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top