question on use of 'OnAction' (solved)

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
Is it possible to use the OnAction property in order to refer to the name of a procedure contained outside the workbook that containing the OnAction code?

The code I want to refer to is in an add-in that is opened whenever Excel starts. I'd like to use OnAction to override the normal print command when the WorkBook is opened, and instead run my add-in code when the print button is pressed or print is selected from the file menu. It works fine when my code procedure is also contained in the same workbook, but I really need to keep my code in a separate add-in as there are multiple workbooks that this is needed in and I need to be able to make changes to my code in one spot.

Thanks,
Kevin
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
still looking for an answer on this, any help is appreciated thank you
 
Upvote 0
never mind, this is solved - i found a post on the board for that recommended using Application.Run to call the macro in the external add-in. I just inserted this code into a macro within my workbook, and then am using the onaction to trigger this macro, which calls the external macro.

thanks,
kevin
 
Upvote 0

Forum statistics

Threads
1,214,389
Messages
6,119,232
Members
448,879
Latest member
VanGirl

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