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
 

Some videos you may like

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

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
 

Watch MrExcel Video

Forum statistics

Threads
1,118,020
Messages
5,569,678
Members
412,287
Latest member
Ardamit
Top