Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
slow macro | Excel Discussion (Misc queries) | |||
Macro is very slow | Excel Discussion (Misc queries) | |||
Slow macro | Excel Programming | |||
Slow macro | Excel Programming | |||
Macro it's very Slow .... | Excel Programming |