View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Sendkeys in Visual Basic

This is a "very" common problem with SendKeys. It's not a metter of slowing
down the VBA, it's a matter of letting the universe respond to the keystrokes.

After a block of SendKeys, issue a:

DoEvents

before moving on.
--
Gary''s Student - gsnu200730


"Zakynthos" wrote:

How do I place a 'pause' using sendkeys?

My problem is this - I need to copy a frame containing data from a web page
and paste it into a particular worksheet in Excel then return to the start
worksheet to begin the routine again.

Sendkeys works fine up to the point of pasting, but the code executes in an
order different from the order in which it was written and returns to the
start sheet and executes before the paste - so the table is incorrectly
pasted into the start sheet.

I've tried 'slowing' the routine down by adding some 'go to's' and sendkeys
"{TABS}" after the paste but it makes no difference - the code still executes
in the wrong order.

Many thanks