ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reassigning macro to add in function (https://www.excelbanter.com/excel-programming/290020-reassigning-macro-add-function.html)

Tom Corcoran

Reassigning macro to add in function
 
I have a button assigned to a macro that I moved to an add on. To reassign
it in the macro name dropdown I type 'My vba code.xla'!MyFunctionName.
But when I click on the button it says Macro MyFunctionName not found.
When I go back into to edit the macro name it has stripped away the xla
reference and just left the macro name which suggests it has found it.
Anyone know what the problem might be?

Regards, Tom.




Nikos Yannacopoulos[_5_]

Reassigning macro to add in function
 
Tom,

Code in add-ins is not run the same way as "local" (in the same workbook or
in personal.xls) code. The button should be made to run a "local" macro ,
which runs the code in the add-in by means of a call like:
Run MyFunctionName
provided, of course, that the add-in is already loaded.

HTH,
Nikos

"Tom Corcoran" wrote in message
...
I have a button assigned to a macro that I moved to an add on. To reassign
it in the macro name dropdown I type 'My vba code.xla'!MyFunctionName.
But when I click on the button it says Macro MyFunctionName not found.
When I go back into to edit the macro name it has stripped away the xla
reference and just left the macro name which suggests it has found it.
Anyone know what the problem might be?

Regards, Tom.






Tom Corcoran

Reassigning macro to add in function
 
Hi Nikos,

"Nikos Yannacopoulos"
Code in add-ins is not run the same way as "local" (in the same workbook

or
in personal.xls) code. The button should be made to run a "local" macro ,
which runs the code in the add-in by means of a call like:
Run MyFunctionName
provided, of course, that the add-in is already loaded.


Thanks for the post. My .xla is stored in the alternate startup file
location and this file is checked in the add-ins list. How can I check that
it is loaded? When I try and open this xla file nothing happens (there was
no password set). This xla file was originally a xls file containing the
macros which I saved as an xla in the alternate startup file location and
then added it as an add-in.

Any advice appreciated,

Thanks, Tom.




All times are GMT +1. The time now is 04:24 AM.

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