Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    U.S. - East Coast
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Custom Shortcuts (2000 SR-3)

    I can't find any info. on how to get a list, using VBA, of custom shortcuts in an Excel 2000 workbook; something akin to Word's KeyBindings collection would be useful. I know how to assign a custom shortcut (Tools|Macro|Macros|Options; or in VBA, Application.MacroOptions), but don't see any method for retrieving a list of these. Any help is greatly appreciated.

  2. #2
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,819
    Thanks
    133
    Thanked 480 Times in 457 Posts

    Re: Custom Shortcuts (2000 SR-3)

    I want that too.

    Have you stumped the experts?

    zeddy

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    U.S. - East Coast
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Shortcuts (2000 SR-3)

    No, just myself! I've asked around and based on the non-response in this forum have concluded that there is no exposed object. This also seems to be the case with PowerPoint, which is not that surprising. However, with Excel I would have expected more. Maybe MSFT needed another item for their list of "new features" for O2003!

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Shortcuts (2000 SR-3)

    OK, I also don't know of a pretty way to get this information. However, I do know an ugly way. If you export a module to a .bas file, you will get something like the following:

    <pre>Attribute VB_Name = "Module1"

    Public Sub CkShortCut()
    Attribute CkShortCut.VB_ProcData.VB_Invoke_Func = "qn14"
    A = 1
    End Sub
    </pre>


    That Attribute statement gives the shortcut key right after the equal sign (in the above case, the shortcut key was Ctrl+q. I'm not sure what the "n14" is. So, one way to get this information is to export all of the modules and then search the .bas files for the Attribute lines.

    I warned you it was ugly.
    Legare Coleman

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Location
    U.S. - East Coast
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Shortcuts (2000 SR-3)

    Ugly, but usable. Thanks for the tip.

  6. #6
    Star Lounger
    Join Date
    Jan 2001
    Location
    U.S. - East Coast
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Shortcuts (2000 SR-3)

    Actually, after playing with it a bit, I see that this solution will only work for recorded macros. If you dynamically assign shortcuts in code, i.e. "Application.OnKey....", there does not seem to be an "Attribute" or some equivalent that can be exported. Otherwise, it's trivial to write an exporter/parser addin to effect your solution.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •