Consulting

Results 1 to 6 of 6

Thread: Debugging VBA?

  1. #1
    VBAX Regular
    Joined
    Jun 2012
    Posts
    7
    Location

    Debugging VBA?

    Trying to debug VBA code. PowerPoint 2003 under Windows XP.

    When I run the code in the *code* window, I can set breakpoints. step through the code and have the VBA interpreter alert me to any VBA code errors. Everything works as I expect.

    But when I start the code from the *slide* window, breakpoints are ignored, and no errors are reported.

    How can I persuade PowerPoint to stop when a breakpoint is reached, and tell me when there are errors, when running the code from the slide window?

    --
    Ian

  2. #2
    VBAX Regular
    Joined
    Jun 2012
    Posts
    7
    Location
    Anna

    I do not understand your reply at all. Could you please re-phrase it.

    Thank you.

    --
    Ian

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    I think you'll find it's not an attempt to be useful just spamming to get their link posted.

    Break points do normally work in slide show mode - are you sure your code is compatable with slide show view? (If you used the recorder it's unlikely that it will be)
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  4. #4
    VBAX Regular
    Joined
    Jun 2012
    Posts
    7
    Location
    John

    Reminder. I am using PPT 2003, if that makes any difference.

    I just created a brand new PPT show, containing a single action button. The Action Setting is linked to mybutton_click:

    Sub mybutton_click()
    
    Dim n As Integer
    n = 0
    n = n + 1
    
     MsgBox "Button clicked"
    
    End Sub
    If I put a breakpoint at n=n+1 and run in the code page, it stops at the breakpoint as expected. But if I run as a slideshow and click on the button, the program does not stop at the breakpoint, but goes on to display the message.

    --
    Ian

  5. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Weird

    I ran your code in 2003 and it stopped at my breakpoint on n=n+1. I have seen other people complaining that breakpoints were ignored in show mode but it doesn't happen here. Not sure what to suggest.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  6. #6
    VBAX Regular
    Joined
    Jun 2012
    Posts
    7
    Location
    John

    Could it be that I am missing an add-in? I had to install the Auto-Events add-in to make my program start properly on opening the slideshow. Maybe I need to do something similar to make breakpoints work in slideshow mode.

    (I am used to them working in Excel and Word when running code from the app window, and I certainly miss them in PowerPoint!).

    --
    Ian

Posting Permissions

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