Another SendKeys  
Author Message

PostPosted: Visual Basic for Applications (VBA), Another SendKeys Top

After Derek's advice a while ago, I had the Send keys function working pefectly. However I have had some testing done on a more powerful machine and when the SendKeys functions takes off, it seems to be holding the keys to be sent so that multiple iterations appear.

For example, I'm trying to send "^f81.". I've had to split this up into "^F","8",".","1" (with the Sendkeys and wait for each sendkeys line). What I end up getting is the search box comes up fine ("^F") but then in the search box I get 888888888888888888811111111111111111...... etc until it comes up with an error because the search string is too long. I've tried different variations with the SendKeys Wait value (True/False) and with the Application.Wait time lapse and it works sometimes but not all the time.

Any ideas out there Because it's driving me mental. the other PC that's being used is still running XP, but has a bit more grunt that the original one it was developed on.

Thanks very much.


Microsoft ISV Community Center Forums3  
U m a n g

PostPosted: Visual Basic for Applications (VBA), Another SendKeys Top

Yes Ben, i also think there is a bug in SendKeys function.I have written about this on Microsoft Website but i am yet to get a satisfactoy reply.

You can also see the thread PostID=656335&SiteID=1 where I was initially trying to enter data in cell A1 and then copy it to cell B2. But it used to enter data in cell B2 only and cell A1 was left blank.

Recently the code has been updated in my thread where now the second argument of the Sendkeys fuction namely. True also doesn't against the Excel Help files which states...

expression.SendKeys(Keys, Wait)

expression Optional. An expression that returns an Application object.

Keys Required Variant. The key or key combination you want to send to the application, as text.

Wait Optional Variant. True to have Microsoft Excel wait for the keys to be processed before returning control to the macro. False (or omitted) to continue running the macro without waiting for the keys to be processed.

Can we have some Excel MVP or Microsoft ISV team comment on this