×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Getting VBA (Powerpoint) to pause
4

Getting VBA (Powerpoint) to pause

Getting VBA (Powerpoint) to pause

(OP)
Hi-

I'm encountering a problem with my code.  I have a code that draws Excel charts into a PowerPoint presentation.  When I step through the macro (with F8), it draws them all just fine.  But if I run the macro without stepping, it gets jammed up at a certain point.  I think I need to put a pause in my code to give it a second to catch up to itself.  Is this likely the problem?  And how do I add a pause?  

Thanks,

Amber

RE: Getting VBA (Powerpoint) to pause

(OP)
I added a message box to slow it down and that worked.  That will work for now, but hitting the message box over and over again might get old.  I'll keep looking for a better answer.

RE: Getting VBA (Powerpoint) to pause

You can use a DoEvents statement to give the other apps a chance to continue. Otherwise, a timer (see VBA help) or a do..loop can give you a pause.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Getting VBA (Powerpoint) to pause

3
Whenever I need a pause (especially useful with a SendKeys statement) I use the following little block:

CODE

Dim WAIT As Double

WAIT = Timer
While Timer < WAIT + 2
   DoEvents  'do nothing
Wend

RE: Getting VBA (Powerpoint) to pause

Oops, forgot to mention that the number after "WAIT +" is the amount of time in seconds you want to pause.  You can use a number less than 1.

RE: Getting VBA (Powerpoint) to pause

Thank you, handleman, for elaborating my sloppy answer.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources