By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

SendKeys / AppActivate Error

P: n/a
Hello:
I have written a very simple vb program (using the new .net interface).
I have a website to which I must upload many files. The filenames are
incremented in such a way that a simple for loop is able to generate
the filenames.
The program itself consists of:
Sub Webpagebuilder()
AppActivate (the IE browser window that I want to interface with)
For i = 1 to 500
'builds the filename here
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("{TAB}")
SendKeys.SendWait(filename)
Next i
Application.exit()
End Sub
The problem is this. The program runs just fine for, about 250
iterations. Sometimes as high as 450, sometimes as low as 150 (these
are all rough numbers). Then it gets out-of-sync with itself in such a
way that it is as if the program skipped one of the tabs.
My question is two-fold: 1) Since I have read that sendkeys is
semi-unreliable, is there a better way to accomplish what I want? 2)
What would be causing otherwise good code to start misbehaving? My
computer fan starts blowing out a lot of air near the time of failure.
I appreciate any help you can provide.
Austin

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.