+ Reply to Thread
Results 1 to 4 of 4

Ctrl Shift | Macro Stops | Creating Short Cut Keys

  1. #1
    Registered User
    Join Date
    04-06-2006
    Posts
    4

    Ctrl Shift | Macro Stops | Creating Short Cut Keys

    I'm currently working on a macro that is embedded in an ".xla" file. I have created a short cut key (ctrl+shift+ K) that executes this macro. However, there is one line of code in the macro where the code stops every time I run it.

    Here is the code:

    Workbooks.Open (TEMPLATE_FILEPATH & "\" & NAME_WKBK)

    This line of code opens a workbook that contains data that I need to access when this macro is run. The variable: TEMPLATE_FILEPATH contains the file path information & NAME_WKBK contains the name of the workbook.

    When I put a breakpoint in the VB editor on this line of code, the code stops there and I can press the "F8" key and then press play and the code will run normally without a problem. However if I don't include a breakpoint, but put a breakpoint on the next subsequent line of code the compiler never makes it past the above line of code.

    The really funny thing about this problem is that if I change the short cut key to "ctrl k" the entire script executes without a problem. For some reason when I am using the open file method and "shift" in the short cut key, the macro does not run all the way through. Can somebody help? If you need a better explanation I would be willing to give one.

  2. #2
    Tom Ogilvy
    Guest

    RE: Ctrl Shift | Macro Stops | Creating Short Cut Keys

    That is correct. If you open a workbook manually and hold down the shift key
    while you open it, the autorun macros are suppressed. It is the same thing
    here - except it causes you macro to terminate. You need to use a shortcut
    key combination that does not include shift.

    --
    Regards,
    Tom Ogilvy


    "gduron" wrote:

    >
    > I'm currently working on a macro that is embedded in an ".xla" file. I
    > have created a short cut key (ctrl+shift+ K) that executes this macro.
    > However, there is one line of code in the macro where the code stops
    > every time I run it.
    >
    > Here is the code:
    >
    > Workbooks.Open (TEMPLATE_FILEPATH & "\" & NAME_WKBK)
    >
    > This line of code opens a workbook that contains data that I need to
    > access when this macro is run. The variable: TEMPLATE_FILEPATH contains
    > the file path information & NAME_WKBK contains the name of the workbook.
    >
    >
    > When I put a breakpoint in the VB editor on this line of code, the code
    > stops there and I can press the "F8" key and then press play and the
    > code will run normally without a problem. However if I don't include a
    > breakpoint, but put a breakpoint on the next subsequent line of code
    > the compiler never makes it past the above line of code.
    >
    > The really funny thing about this problem is that if I change the short
    > cut key to "ctrl k" the entire script executes without a problem. For
    > some reason when I am using the open file method and "shift" in the
    > short cut key, the macro does not run all the way through. Can somebody
    > help? If you need a better explanation I would be willing to give one.
    >
    >
    > --
    > gduron
    > ------------------------------------------------------------------------
    > gduron's Profile: http://www.excelforum.com/member.php...o&userid=33239
    > View this thread: http://www.excelforum.com/showthread...hreadid=530592
    >
    >


  3. #3
    Registered User
    Join Date
    04-06-2006
    Posts
    4

    Ctrl Shift | Macro Stops | Creating Short Cut Keys

    Thanks for your reply Tom, I was unaware of that interesting fact. I'm still faced with the problem though of how can I have multiple macros in xla files with different short cut keys that do not overwrite the already existing short cut keys.

    I have multiple projects that I'm working on, and I need to have many different short cut keys and so the "ctrl" key alone causes me to over write other shortcuts.

    Is there no way to create a short cut key with some other combination that will make it so I don't overwrite the other pre-existing short cuts? I hope I've made my question clear enough.

    Thanks

  4. #4
    Tom Ogilvy
    Guest

    Re: Ctrl Shift | Macro Stops | Creating Short Cut Keys

    Possibly using Onkey and using a macro to make the assignments.

    --
    Regards,
    Tom Ogilvy


    "gduron" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Thanks for your reply Tom, I was unaware of that interesting fact. I'm
    > still faced with the problem though of how can I have multiple macros
    > in xla files with different short cut keys that do not overwrite the
    > already existing short cut keys.
    >
    > I have multiple projects that I'm working on, and I need to have many
    > different short cut keys and so the "ctrl" key alone causes me to over
    > write other shortcuts.
    >
    > Is there no way to create a short cut key with some other combination
    > that will make it so I don't overwrite the other pre-existing short
    > cuts? I hope I've made my question clear enough.
    >
    > Thanks
    >
    >
    > --
    > gduron
    > ------------------------------------------------------------------------
    > gduron's Profile:

    http://www.excelforum.com/member.php...o&userid=33239
    > View this thread: http://www.excelforum.com/showthread...hreadid=530592
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1