Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I may have 2 or 3 workbooks open, each has a custom print macro that is
activated with Ctrl-P. However, Ctrl P does not call the macro from the active workbook. Seems like I read somewhere when there are duplicate shortcut keys, Excel calls macros from workbooks in alphabetical order. How can I force Excel to call the macro from the active workbook? Thank you. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You would be better off saving the macro in PERSONAL.xls then it would be available on the activeworkbook on demand. John;512523 Wrote: I may have 2 or 3 workbooks open, each has a custom print macro that is activated with Ctrl-P. However, Ctrl P does not call the macro from the active workbook. Seems like I read somewhere when there are duplicate shortcut keys, Excel calls macros from workbooks in alphabetical order. How can I force Excel to call the macro from the active workbook? Thank you. -- Simon Lloyd Regards, Simon Lloyd 'Microsoft Office Help' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=140789 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Unless you have written code to override it, Ctl + P is the same as using
FilePrint from the menu bar or ActiveSheet.PrintOut from code. In other words, it uses the built in print command. There are no user developed print procedures involved, and no alphabetic selection of workbooks. The print command is at the application level, not the lower workbook level. "John" wrote in message ... I may have 2 or 3 workbooks open, each has a custom print macro that is activated with Ctrl-P. However, Ctrl P does not call the macro from the active workbook. Seems like I read somewhere when there are duplicate shortcut keys, Excel calls macros from workbooks in alphabetical order. How can I force Excel to call the macro from the active workbook? Thank you. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Another thought. Even if you have overridden the application print command
with a user developed macro, the keyboard shortcut will call whatever was assigned to that shortcut when it was created, in the method defined by the code that the procedure executes. So there is still no alphabetic selection of workbooks. It selects what it is told to select by code. "John" wrote in message ... I may have 2 or 3 workbooks open, each has a custom print macro that is activated with Ctrl-P. However, Ctrl P does not call the macro from the active workbook. Seems like I read somewhere when there are duplicate shortcut keys, Excel calls macros from workbooks in alphabetical order. How can I force Excel to call the macro from the active workbook? Thank you. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try making a generic sub (which is the same in all workbooks) just to
capture the Ctrl+p and which then calls the "real" print macro in the activeworkbook. Sub PrintMeStarter() Application.Run (ActiveWorkbook.Name & "!PrintMe") End Sub You'll have to handle catching an error if the active workbook doesn't have a PrintMe() sub. Maybe just call the "regular" print in that case. Tim. "John" wrote in message ... I may have 2 or 3 workbooks open, each has a custom print macro that is activated with Ctrl-P. However, Ctrl P does not call the macro from the active workbook. Seems like I read somewhere when there are duplicate shortcut keys, Excel calls macros from workbooks in alphabetical order. How can I force Excel to call the macro from the active workbook? Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I call up a line of code that references a cell/range in theactive workbook workbook where I am running my macro from? | Excel Programming | |||
need macro to call a workbook w/o the actual name of the workbook | Excel Programming | |||
Call macro stored in Excel workbook from Outlook's macro | Excel Programming | |||
How to call macro from other workbook | Excel Programming | |||
Call macro from active workbook-duplicate shortcut keys | Excel Programming |