Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Shortcut key for add-in macro (Excel 2007)

I cannot see how to see or change the hotkey assigned to a macro that is part
of an add-in. I can see/change on a "conventional" recorded macro.
(DeveloperMacroOptions), but the Option button doesn't exist in the VB
Editor version. (VBEToolsMacros)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Shortcut key for add-in macro (Excel 2007)

There is no interface in the VBE for you to add the shortcut. Use the one in
Excel that you have already found or Alt-F8, Options.

You can edit the macro Description in the VBE via the Object browser, but
easier to use Alt-F8.

You can also add or edit the shortcut if you edit the bas module in a text
editor (after exporting it), but again easier to use Alt-F8 in Excel.

There is also Application.Onkey which you might like to look at in help.

Regards,
Peter T

"FHgm" wrote in message
...
I cannot see how to see or change the hotkey assigned to a macro that is
part
of an add-in. I can see/change on a "conventional" recorded macro.
(DeveloperMacroOptions), but the Option button doesn't exist in the VB
Editor version. (VBEToolsMacros)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Shortcut key for add-in macro (Excel 2007)



"Peter T" wrote:

There is no interface in the VBE for you to add the shortcut. Use the one in
Excel that you have already found or Alt-F8, Options.


Thanks for the reply Peter,

I'm still having problems though - the macros that I have as an "add-in"
don't show up with Alt-F8. I'm not sure why. I think they did in 2003. I
added the short cut keys when I was using Excel 2003. But now that I'm using
2007, the macros in the "add-in" don't show up.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Shortcut key for add-in macro (Excel 2007)

Are you sure macros are enabled in your Excel 2007

Regards,
Peter T

"FHgm" wrote in message
...


"Peter T" wrote:

There is no interface in the VBE for you to add the shortcut. Use the one
in
Excel that you have already found or Alt-F8, Options.


Thanks for the reply Peter,

I'm still having problems though - the macros that I have as an "add-in"
don't show up with Alt-F8. I'm not sure why. I think they did in 2003.
I
added the short cut keys when I was using Excel 2003. But now that I'm
using
2007, the macros in the "add-in" don't show up.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Shortcut key for add-in macro (Excel 2007)

Are you sure macros are enabled in your Excel 2007

Regards,
Peter T


Yes, this is the odd thing. The macros work just fine. But there are NO
macros listed if I press Alt-F8 (in fact all the buttons except "Cancel" are
grey'ed out.)


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Shortcut key for add-in macro (Excel 2007)

Easy to replicate:

Open new workbook (Cntl-N)
Press Record Macro
Name it, and assign to Cntl-Q
(have macro do something simple: add 2 numbers or something)
Now save worksheet as an add-in (either .xlam or .xla)
Close this workbook

Open new workbook
Go to options addin : and now add in the just created .xla file

Note that Cntl-Q works - but there is no way to see this macro using Alt-F8
or to see what hotkey is assigned, or to reassign the key. (Or to run it if
you didn't know it existed...)

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Shortcut key for add-in macro (Excel 2007)

I didn't realise you were talking about an addin. Macros in addins are not
visible in the Alt-F8 dialog in any Excel version. Normally their macros are
called from a menu button or a shortcut created with OnKey in the Open event
(as I mentioned last time, see OnKey in help).

If you really want to use the shortcut method you'd apply via Alt-F8, the
only way (other than temporarily changing the IsAddin property) is to edit
the bas module in a text method

Export the bas module and remove it
In say Notepad add the first two lines after the macro name


Sub MyMacro()
Attribute MyMacro.VB_Description = "my Macro description"
Attribute MyMacro.VB_ProcData.VB_Invoke_Func = "D\n14"

' shortcutkey is Ctrl-Shift-d
Msgbox My Macro

End Sub

Import the bas module

I should add this is not the recommended way to do it, use OnKey

Regards,
Peter T






"FHgm" wrote in message
...
Easy to replicate:

Open new workbook (Cntl-N)
Press Record Macro
Name it, and assign to Cntl-Q
(have macro do something simple: add 2 numbers or something)
Now save worksheet as an add-in (either .xlam or .xla)
Close this workbook

Open new workbook
Go to options addin : and now add in the just created .xla file

Note that Cntl-Q works - but there is no way to see this macro using
Alt-F8
or to see what hotkey is assigned, or to reassign the key. (Or to run it
if
you didn't know it existed...)



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Shortcut key for add-in macro (Excel 2007)

PS

Ensure the first line in the text editor is something like this (obviously
with the correct module name)

Attribute VB_Name = "Module1"

Peter T


"Peter T" <peter_t@discussions wrote in message
...
I didn't realise you were talking about an addin. Macros in addins are not
visible in the Alt-F8 dialog in any Excel version. Normally their macros
are called from a menu button or a shortcut created with OnKey in the Open
event (as I mentioned last time, see OnKey in help).

If you really want to use the shortcut method you'd apply via Alt-F8, the
only way (other than temporarily changing the IsAddin property) is to edit
the bas module in a text method

Export the bas module and remove it
In say Notepad add the first two lines after the macro name


Sub MyMacro()
Attribute MyMacro.VB_Description = "my Macro description"
Attribute MyMacro.VB_ProcData.VB_Invoke_Func = "D\n14"

' shortcutkey is Ctrl-Shift-d
Msgbox My Macro

End Sub

Import the bas module

I should add this is not the recommended way to do it, use OnKey

Regards,
Peter T



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Shortcut do not work JHL Excel Discussion (Misc queries) 5 October 28th 09 04:00 PM
Excel 2007 shortcut keys [email protected] Excel Discussion (Misc queries) 0 May 1st 09 06:17 PM
Shortcut keys in Excel 2007 luisaam Excel Worksheet Functions 0 June 25th 08 11:23 PM
Excel 2007 - Macro Shortcut Key Doesn't Work John Schneider Excel Programming 3 June 2nd 08 07:11 PM
Excel 2007 '/' Shortcut Matthew Excel Discussion (Misc queries) 2 August 12th 06 11:15 PM


All times are GMT +1. The time now is 09:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"