ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hotkey in proper workbook (https://www.excelbanter.com/excel-programming/446597-hotkey-proper-workbook.html)

Charlotte E.[_3_]

Hotkey in proper workbook
 
I have a workbook containing a macro, which is activated by a hothey
combination (CTRL + SHIFT + N).

This hotkey combination is created with 'Application.MacroOptions' in
the Workbook_Open event.

And everything works fine :-)

But, if I open another workbook, which also uses this hotkey combination
for running some other macro, it goes wrong!

Even that the hotkeys are defined in their own workbooks, and the macros
are contained in their own workbooks, when hitting the hotkey in one
workbook, it will run the macro from the other workbook?!?

Why?
How to avoid this?


Thanks

CE

Vacuum Sealed

Hotkey in proper workbook
 
On 18/07/2012 8:43 PM, Charlotte E. wrote:
I have a workbook containing a macro, which is activated by a hothey
combination (CTRL + SHIFT + N).

This hotkey combination is created with 'Application.MacroOptions' in
the Workbook_Open event.

And everything works fine :-)

But, if I open another workbook, which also uses this hotkey combination
for running some other macro, it goes wrong!

Even that the hotkeys are defined in their own workbooks, and the macros
are contained in their own workbooks, when hitting the hotkey in one
workbook, it will run the macro from the other workbook?!?

Why?
How to avoid this?


Thanks

CE

I suspect you should change the term "Application" as it is global and
will affect all workbooks inside Excel itself...

Try setting it to Active Workbook instead thus making it local to each....

HTH
Mick.




Charlotte E.[_3_]

Hotkey in proper workbook
 
Would have been easy, but neither ThisWorkbook or ActiveWorkbook support
the .MacroOptions method.


CE


Den 18.07.2012 15:33, Vacuum Sealed skrev:
On 18/07/2012 8:43 PM, Charlotte E. wrote:
I have a workbook containing a macro, which is activated by a hothey
combination (CTRL + SHIFT + N).

This hotkey combination is created with 'Application.MacroOptions' in
the Workbook_Open event.

And everything works fine :-)

But, if I open another workbook, which also uses this hotkey combination
for running some other macro, it goes wrong!

Even that the hotkeys are defined in their own workbooks, and the macros
are contained in their own workbooks, when hitting the hotkey in one
workbook, it will run the macro from the other workbook?!?

Why?
How to avoid this?


Thanks

CE

I suspect you should change the term "Application" as it is global and
will affect all workbooks inside Excel itself...

Try setting it to Active Workbook instead thus making it local to each....

HTH
Mick.





All times are GMT +1. The time now is 11:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com