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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
can anyone help w this

thank you
 

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
still looking for an answer on this, any help is appreciated thank you
 

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,130
Messages
5,857,551
Members
431,885
Latest member
Rsdg

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
Top