Activating macro with a Toolbar

JeffSavoie

New Member
Joined
Apr 10, 2002
Messages
7
I have two XLA containing macro (setup.xla and main.xla).

I have a toolbar with button that should start macro.

I want to set the button with a macro from SETUP.XLA to start macro from MAIN.XLA.

My line in SETUP.XLA, to set the button, is :
Toolbars(sTBName).ToolbarButtons(TB_POSOPENTOOL).OnAction = StartProgram

--> [StartProgram] is a macro in the MAIN.XLA file

The problem i get is when i clic on the button Excel is looking for the macro [StartProgram] in SETUP.XLA and can't find it (because it's in MAIN.XLA).

Is there any way to specify that the macro to start onAction is located in the MAIN.XLA and not in SETUP.XLA ?

Thanks !
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Why can't you just assign the macro from main.xla to the button without referencing setup.xla?
 
Upvote 0
On 2002-04-22 07:26, klb wrote:
Why can't you just assign the macro from main.xla to the button without referencing setup.xla?

It would long to explain, but i cannot... :(

I try to figure if there is a way to do it like that because i need it to work like that. I hope there is a solution !
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top