ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reading back a Read/Write Property (https://www.excelbanter.com/excel-programming/401294-reading-back-read-write-property.html)

Gary''s Student

Reading back a Read/Write Property
 
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)
--
Gary''s Student - gsnu200757

Leith Ross[_2_]

Reading back a Read/Write Property
 
On Nov 17, 4:05 pm, Gary''s Student
wrote:
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)
--
Gary''s Student - gsnu200757


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

Peter T

Reading back a Read/Write Property
 
Still same way as I suggested to you last time :-)

http://tinyurl.com/2qxjmx

Regards,
Peter T


"Gary''s Student" wrote in message
...
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)
--
Gary''s Student - gsnu200757





All times are GMT +1. The time now is 09:40 AM.

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