Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i am using an add-in to store macro's ("personal.xla" in C:\Documents and
Settings\mvyvoda\Application Data\Microsoft\AddIns). I need to have a keyboard shortcut to one fuction within this add-in. The macro list (Alt-F8) does not list any macro's in personal.xla. i'm not even sure where to start. thanks, -m |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Application.OnKey "+^D", "MyMacro"
This should create a shortcut Shift-Ctrl-D. If there's any possibility MyMacro may exist in any other workbook prefix with ThisWorkbook.Name & "!". Call it from an Open event. Not sure about naming your addin "Personal.xla" if there may also be a Personal.xls open, guess it's OK but I wouldn't. Regards, Peter T "mvyvoda" wrote in message ... i am using an add-in to store macro's ("personal.xla" in C:\Documents and Settings\mvyvoda\Application Data\Microsoft\AddIns). I need to have a keyboard shortcut to one fuction within this add-in. The macro list (Alt-F8) does not list any macro's in personal.xla. i'm not even sure where to start. thanks, -m |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter,
When I do this, and get rid of the menu already in place (but run your code) I get an error: The macro" C:\..\AddIns\personal.xla'!AddMenu' cannot be found do you what this means? Thanks, -m "Peter T" wrote: Application.OnKey "+^D", "MyMacro" This should create a shortcut Shift-Ctrl-D. If there's any possibility MyMacro may exist in any other workbook prefix with ThisWorkbook.Name & "!". Call it from an Open event. Not sure about naming your addin "Personal.xla" if there may also be a Personal.xls open, guess it's OK but I wouldn't. Regards, Peter T "mvyvoda" wrote in message ... i am using an add-in to store macro's ("personal.xla" in C:\Documents and Settings\mvyvoda\Application Data\Microsoft\AddIns). I need to have a keyboard shortcut to one fuction within this add-in. The macro list (Alt-F8) does not list any macro's in personal.xla. i'm not even sure where to start. thanks, -m |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why do you "get rid of the menu already in place"
Is AddMenu a Sub with no arguments Do you have a similarly named AddMenu sub in any other workbook (incl addins), if so did you prefix the way I suggested. Apart from your Personal.xla do you also have Personal.xls, if so try renaming the addin. Regards, Peter T "mvyvoda" wrote in message ... Peter, When I do this, and get rid of the menu already in place (but run your code) I get an error: The macro" C:\..\AddIns\personal.xla'!AddMenu' cannot be found do you what this means? Thanks, -m "Peter T" wrote: Application.OnKey "+^D", "MyMacro" This should create a shortcut Shift-Ctrl-D. If there's any possibility MyMacro may exist in any other workbook prefix with ThisWorkbook.Name & "!". Call it from an Open event. Not sure about naming your addin "Personal.xla" if there may also be a Personal.xls open, guess it's OK but I wouldn't. Regards, Peter T "mvyvoda" wrote in message ... i am using an add-in to store macro's ("personal.xla" in C:\Documents and Settings\mvyvoda\Application Data\Microsoft\AddIns). I need to have a keyboard shortcut to one fuction within this add-in. The macro list (Alt-F8) does not list any macro's in personal.xla. i'm not even sure where to start. thanks, -m |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I got rid of the menu already in place to test to see if the ctrl+shift+D
would work if only personal.xla was in place and never ran. also, i did rename the file, to no avail. I don't have any other macro's that are similarly named. AddMenu is a pretty typical routine that merely adds a menu, names it and places arguments (attached to macros of course) within the menu. Peter, I really appreciate all your help!!, -m "Peter T" wrote: Why do you "get rid of the menu already in place" Is AddMenu a Sub with no arguments Do you have a similarly named AddMenu sub in any other workbook (incl addins), if so did you prefix the way I suggested. Apart from your Personal.xla do you also have Personal.xls, if so try renaming the addin. Regards, Peter T "mvyvoda" wrote in message ... Peter, When I do this, and get rid of the menu already in place (but run your code) I get an error: The macro" C:\..\AddIns\personal.xla'!AddMenu' cannot be found do you what this means? Thanks, -m "Peter T" wrote: Application.OnKey "+^D", "MyMacro" This should create a shortcut Shift-Ctrl-D. If there's any possibility MyMacro may exist in any other workbook prefix with ThisWorkbook.Name & "!". Call it from an Open event. Not sure about naming your addin "Personal.xla" if there may also be a Personal.xls open, guess it's OK but I wouldn't. Regards, Peter T "mvyvoda" wrote in message ... i am using an add-in to store macro's ("personal.xla" in C:\Documents and Settings\mvyvoda\Application Data\Microsoft\AddIns). I need to have a keyboard shortcut to one fuction within this add-in. The macro list (Alt-F8) does not list any macro's in personal.xla. i'm not even sure where to start. thanks, -m |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
oh... I misnamed AddMenu. It works now, however I have a final question. I
have a scenario whereby I need this ctrl+shift+D to work in a situation where someone has never ran the AddMenu routine. Is this possible? Or, do I have to run AddMenu with the added ctrl+shift+D code before they can use ctrl+shift+D? If you follow? Thanks, -m "mvyvoda" wrote: I got rid of the menu already in place to test to see if the ctrl+shift+D would work if only personal.xla was in place and never ran. also, i did rename the file, to no avail. I don't have any other macro's that are similarly named. AddMenu is a pretty typical routine that merely adds a menu, names it and places arguments (attached to macros of course) within the menu. Peter, I really appreciate all your help!!, -m "Peter T" wrote: Why do you "get rid of the menu already in place" Is AddMenu a Sub with no arguments Do you have a similarly named AddMenu sub in any other workbook (incl addins), if so did you prefix the way I suggested. Apart from your Personal.xla do you also have Personal.xls, if so try renaming the addin. Regards, Peter T "mvyvoda" wrote in message ... Peter, When I do this, and get rid of the menu already in place (but run your code) I get an error: The macro" C:\..\AddIns\personal.xla'!AddMenu' cannot be found do you what this means? Thanks, -m "Peter T" wrote: Application.OnKey "+^D", "MyMacro" This should create a shortcut Shift-Ctrl-D. If there's any possibility MyMacro may exist in any other workbook prefix with ThisWorkbook.Name & "!". Call it from an Open event. Not sure about naming your addin "Personal.xla" if there may also be a Personal.xls open, guess it's OK but I wouldn't. Regards, Peter T "mvyvoda" wrote in message ... i am using an add-in to store macro's ("personal.xla" in C:\Documents and Settings\mvyvoda\Application Data\Microsoft\AddIns). I need to have a keyboard shortcut to one fuction within this add-in. The macro list (Alt-F8) does not list any macro's in personal.xla. i'm not even sure where to start. thanks, -m |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm sorry I don't follow any of the discussion about menus but I think
I can answer the orginal question. Here are two ways to add a keyboard shortcut to an add-in subroutine: Manually: 1) Open the macro listToolsMacroMacros... 2) You won't see your subroutine listed, but when you type in the full name of the macro the Options button will become enabled. Click the Options button and enter your shortcut. 3) Be sure to save your add-in from the VBE window. By Code: 1) Write a Private Sub in your add-in. 2) Enter the following code: Application.MacroOptions Macro:="MyMacro", _ HasShortCutKey:=True, _ ShortcutKey:="V" 'Alt+Shift+v 3) Run this macro from the VBE window once and save the add-in. Dave Parker mvyvoda wrote: i am using an add-in to store macro's ("personal.xla" in C:\Documents and Settings\mvyvoda\Application Data\Microsoft\AddIns). I need to have a keyboard shortcut to one fuction within this add-in. The macro list (Alt-F8) does not list any macro's in personal.xla. i'm not even sure where to start. thanks, -m |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This most certainly is a work around that will have to do for now.
Thanks, -m " wrote: I'm sorry I don't follow any of the discussion about menus but I think I can answer the orginal question. Here are two ways to add a keyboard shortcut to an add-in subroutine: Manually: 1) Open the macro listToolsMacroMacros... 2) You won't see your subroutine listed, but when you type in the full name of the macro the Options button will become enabled. Click the Options button and enter your shortcut. 3) Be sure to save your add-in from the VBE window. By Code: 1) Write a Private Sub in your add-in. 2) Enter the following code: Application.MacroOptions Macro:="MyMacro", _ HasShortCutKey:=True, _ ShortcutKey:="V" 'Alt+Shift+v 3) Run this macro from the VBE window once and save the add-in. Dave Parker mvyvoda wrote: i am using an add-in to store macro's ("personal.xla" in C:\Documents and Settings\mvyvoda\Application Data\Microsoft\AddIns). I need to have a keyboard shortcut to one fuction within this add-in. The macro list (Alt-F8) does not list any macro's in personal.xla. i'm not even sure where to start. thanks, -m |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
keyboard shortcut | Excel Discussion (Misc queries) | |||
Keyboard shortcut: something new | Excel Discussion (Misc queries) | |||
Keyboard shortcut for name box | Excel Discussion (Misc queries) | |||
Keyboard shortcut for Best Fit | Excel Discussion (Misc queries) | |||
Keyboard Shortcut | Excel Discussion (Misc queries) |