Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Slow down SendKeys macro

Hello,

I have a macro that sends several sendkey commands to modify some
settings within a printer's print settings dialog box. The problem is
that the macro seems to be too fast for the application at times, and
the keys are sent before the application is at the place it needs to
be. If I print the macro and key the sequence in by hand it works
perfectly. I would like to add a quarter second delay between all the
keys that are pressed in the sequence if possible. I've examined some
loop commands, but they have resulted in much more agony than help. Any
idea on how to keep the macro from moving too fast? Thanks for any
help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Slow down SendKeys macro

Try this:

At the top of the normal code module put this:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Then at any place in your code you want a delay put:
Sleep 250

Experiment with the number 250 and see if you need more delay or if you can
do with less.

RBS


wrote in message
oups.com...
Hello,

I have a macro that sends several sendkey commands to modify some
settings within a printer's print settings dialog box. The problem is
that the macro seems to be too fast for the application at times, and
the keys are sent before the application is at the place it needs to
be. If I print the macro and key the sequence in by hand it works
perfectly. I would like to add a quarter second delay between all the
keys that are pressed in the sequence if possible. I've examined some
loop commands, but they have resulted in much more agony than help. Any
idea on how to keep the macro from moving too fast? Thanks for any
help.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
slow macro :)[_2_] Excel Discussion (Misc queries) 1 March 3rd 10 02:41 PM
Macro is very slow jlclyde Excel Discussion (Misc queries) 2 September 29th 08 04:43 PM
Slow macro AG Excel Programming 5 August 25th 05 01:25 AM
Slow macro alf bryn Excel Programming 5 August 5th 05 12:27 AM
Macro it's very Slow .... leo_nunez[_2_] Excel Programming 4 August 28th 04 03:45 PM


All times are GMT +1. The time now is 03:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"