ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trouble With MacroOptions (https://www.excelbanter.com/excel-programming/348976-trouble-macrooptions.html)

Sprinks

Trouble With MacroOptions
 
I'm trying to test setting the macro hotkey programmatically. The first
attempt is trying to remove the hotkey assignment for a macro named
"RoundOnePlace". The following code runs without error, but does not remove
the hotkey assignment.

Public Sub TestMacroAssign()
Application.MacroOptions Macro:="RoundOnePlace", HasShortcutKey:=False
End Sub

Should I discover what I'm doing wrong, I also need to know:
- What values for ShortcutKey correspond to Ctrl-(letter), and
Ctrl-Shft(letter)
- If there is a Macros collection that I can loop through

Thanks.
Sprinks

Bob Phillips[_6_]

Trouble With MacroOptions
 
I get rid of them like this

Application.MacroOptions Macro:="RoundOnePlace", ShortcutKey:=""

They are automatically assigned Ctrl-key, and the SXhift c omes into play if
you use a shifted character, such as A, or :.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Sprinks" wrote in message
...
I'm trying to test setting the macro hotkey programmatically. The first
attempt is trying to remove the hotkey assignment for a macro named
"RoundOnePlace". The following code runs without error, but does not

remove
the hotkey assignment.

Public Sub TestMacroAssign()
Application.MacroOptions Macro:="RoundOnePlace", HasShortcutKey:=False
End Sub

Should I discover what I'm doing wrong, I also need to know:
- What values for ShortcutKey correspond to Ctrl-(letter), and
Ctrl-Shft(letter)
- If there is a Macros collection that I can loop through

Thanks.
Sprinks




Sprinks

Trouble With MacroOptions
 
Thanks, Bob. That works.

Sprinks

"Bob Phillips" wrote:

I get rid of them like this

Application.MacroOptions Macro:="RoundOnePlace", ShortcutKey:=""

They are automatically assigned Ctrl-key, and the SXhift c omes into play if
you use a shifted character, such as A, or :.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Sprinks" wrote in message
...
I'm trying to test setting the macro hotkey programmatically. The first
attempt is trying to remove the hotkey assignment for a macro named
"RoundOnePlace". The following code runs without error, but does not

remove
the hotkey assignment.

Public Sub TestMacroAssign()
Application.MacroOptions Macro:="RoundOnePlace", HasShortcutKey:=False
End Sub

Should I discover what I'm doing wrong, I also need to know:
- What values for ShortcutKey correspond to Ctrl-(letter), and
Ctrl-Shft(letter)
- If there is a Macros collection that I can loop through

Thanks.
Sprinks






All times are GMT +1. The time now is 02:04 PM.

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