Reading back a Read/Write Property

G

Gary''s Student

Usually, once I set a property like a cell's format:

Range("A1").NumberFormat = "@"

I don't need to "remember" it. I can just read it back with:

Dim s as String
s = Range("A1").NumberFormat

However, once I set a macro's shortcutkey:

Application.MacroOptions Macro:="Macro1", ShortcutKey:= "e"

The correct method to retrieve the property eludes me. I am looking for the
equivalent of:

s = MacroOptions.Macro("Macro1").ShortcutKey

(hopefully macros are part of the object model with read/write properties of
their own)
 
L

Leith Ross

Usually, once I set a property like a cell's format:

Range("A1").NumberFormat = "@"

I don't need to "remember" it. I can just read it back with:

Dim s as String
s = Range("A1").NumberFormat

However, once I set a macro's shortcutkey:

Application.MacroOptions Macro:="Macro1", ShortcutKey:= "e"

The correct method to retrieve the property eludes me. I am looking for the
equivalent of:

s = MacroOptions.Macro("Macro1").ShortcutKey

(hopefully macros are part of the object model with read/write properties of
their own)

Hello Gary,

The setting of the shortcut key, or hot key as is sometimes called, is
actually performed by a couple of API calls. So, while you can set the
key, Excel does not provide any methods to read these settings back.
You write an API macro to do this, if really need it.

Sincerely,
Leith Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top