Pause in VBA

R

Rob Kell

Can anyone tell me how I can pause a running VBA script for a few seconds.
The problem is that part of my code performs certain key strokes and the next
part of the code opens a form. The opening of the form interferes with the
keystrokes. The keystrokes are to set duplex on the printer, the form asks
how many copies of the printing are required. I need the duplex set before
the form appears. Any ideas?
 
R

Rob Kell

I am using send keys but the form.show is interferring with them. The "Wait"
is not available in Word VBA, only Excel or Access as far as I can see.
 
B

Bob I

Sub SendKeys(String As String, [Wait])

Rob said:
I am using send keys but the form.show is interferring with them. The "Wait"
is not available in Word VBA, only Excel or Access as far as I can see.

:
 
R

Rob Kell

Bob. The response is not clear to me.

Are you saying that I can create a subroutine with variables of String and
Wait? or are you suggesting that there is a Microsoft standard procedure
called SendKeys?

I need more info please.

Bob I said:
Sub SendKeys(String As String, [Wait])

Rob said:
I am using send keys but the form.show is interferring with them. The "Wait"
is not available in Word VBA, only Excel or Access as far as I can see.

:
 
B

Bob I

Standard procedure, hit "Object" button and enter Sendkeys to see it.

Rob said:
Bob. The response is not clear to me.

Are you saying that I can create a subroutine with variables of String and
Wait? or are you suggesting that there is a Microsoft standard procedure
called SendKeys?

I need more info please.

:

Sub SendKeys(String As String, [Wait])

Rob Kell wrote:

I am using send keys but the form.show is interferring with them. The "Wait"
is not available in Word VBA, only Excel or Access as far as I can see.

:



Are you using "SendKeys"? Set the "wait" to "true".

Rob Kell wrote:



Can anyone tell me how I can pause a running VBA script for a few seconds.
The problem is that part of my code performs certain key strokes and the next
part of the code opens a form. The opening of the form interferes with the
keystrokes. The keystrokes are to set duplex on the printer, the form asks
how many copies of the printing are required. I need the duplex set before
the form appears. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top