Results 1 to 8 of 8
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Interrupt running VBA code (Word97 Sr2b)

    hey jscher
    another question for VB..
    when you run code via pressing a button on a custom menu
    theres a serious of keys you can press to break to a line of code.
    The keys were something like CTRL Pause Break or F8 Break & it takes you straight to the line of code.
    Do you know what these keys are? kind regards Diana

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Interrupt running VBA code (Word97 Sr2b)

    If you press Ctrl+Break, you should get the dialog "Code execution has been interrupted" with the buttons Continue, End, Debug, Help. Clicking Debug should take you to the line at which you stopped. This can be very random, though, so if you are looking to stop at a particular line, you can place a Stop statement in your code at the relevant point. There also are breakpoints in the editor, but I never use that feature and have no idea why it would be better.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Interrupt running VBA code (Word97 Sr2b)

    hi -I ran the code & pressed keys CTRL+Break
    I've previoulsy seen the message 'Code execution interupted..' however it doesnt appear.

    What I want to do - find out is...
    when users press a serious of keyboard shortcuts
    a dialog box appears which they enter data.
    I'm not familiar with this dialog box - old code thats hidden in 1 of the many templates our company has.
    I've looked in our template files & couldnt find any references to this dialog box.

    I'm wanting to track down which template file this dialog box is stored in.
    I was hoping if I ran the code & did a CTRL Break - it would pause the code & take me directly to the code to do with this dialog box.
    Is there another way I can do this? - regards Diana

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Interrupt running VBA code (Word97 Sr2b)

    I've moved this thread to the VB/VBA board for further inspirations.

    Can you diagnose it from the customize keyboard dialog?

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Interrupt running VBA code (Word97 Sr2b)

    Diana,

    If it's a form that the user can enter information into, and it was created using Word 97, then it either has to be an InputBox or a userform. To find an InputBox, for each template you'd need to go to a code module and then do a Find on "InputBox", specifying that you want to search the entire project. If it's a userform, then you can look at the project explorer window for each template, and examine any Forms that may exist in the project.

    If the form was created using WordBasic code, it will not appear as a form in the project explorer, but there might be some 'signature' WordBasic code relating to building forms, which you could do a Find on (sorry I can't tell you what that signature code might look like).

    Gary

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Interrupt running VBA code (Word97 Sr2b)

    HI Gary - I managed to track down the dlg box.
    Your right - it was Wordbasic code - therefore the dialog box was created via code
    & not in Word97 - VBA using form objects.

    I managed to track down via this method:
    the way it was designed - was the only way to run the code - was via keyboard shortcuts.
    So in Word menu Tools>Customise>Keyboard> Categories >Macros -went though all the macros to locate the keyboard shortcuts.
    When I found it - it displays the macro name - however doesnt display the template project folder the code is associated with.
    (lots of company templates & code)
    So then I had to go through each template & find the module - code.
    Tedious I know but I acheived the goal.

    Do you know of another method-process I could have achieved this faster? Diana

  7. #7
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Interrupt running VBA code (Word97 Sr2b)

    Diana,

    Glad you found it.
    The only way to achieve this faster in the future would be to reorganize your company's global templates/code modules into more logical units - sounds like this would be worth doing anyway.

    Gary

  8. #8
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Interrupt running VBA code (Word97 Sr2b)

    Gary - we'll do a big overhaul of the templates & code when the company moves to XP - thanks for your help - Diana

Posting Permissions

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