PDA

View Full Version : Automating IE7 in Vista



Btibert3
01-22-2009, 12:51 PM
Hi Everyone,

After countless hours of trying to figure out how to do the basic automation of IE, I am stuck at a point in my code that I thought was straight forward.

I have scoured the internet, and the general conclusion is that I should be able to send the click command to request the page.

My code is below:

oIE.Document.all("ctl00$ContentPlaceHolder1$txtGamertag").Value = "username"
oIE.Document.all("ctl00$ContentPlaceHolder1$btnSearch").Click


The click doesnt work. If I were not using VBA, I could simply click enter on my keyboard or select the search icon on the page. I am stuck as to why I can not successfully submit the page in VBA.

Here is the snippet of the html that I believe has everything that I need. The thing that is throwing me off is that it appears there is a javascript that fires on keypress, but I dont know if that matters or not for my problem.

Any insight or direction you can give me will be much appreciated. Unless all else fails (which it probably will at the pace I am going with this) I should be all set.

Many, many, many thanks in advance,

Brock

P.S. Because I am new to this forum, apparently I cannot place links. Therefore, the site I am referring to is the Gears of War 2 webstats page for all of the video game players out there.

CreganTur
01-23-2009, 06:31 AM
Automating IE via VBA can be a dubious task. It's possible, but not gauranteed to work, expecially since web devs can use so many objects that VBA can't interact with.

Depending on what you want to do, using an automation suite might make more sense. You might want to take a look at vTask Studio (http://www.vista-software.com/index.php). It's really easy to learn, and very powerful. I've actually built a lot of automation apps for the company I work for where VBA wasn't a viable option.

Btibert3
01-23-2009, 10:12 AM
Thanks for the help. Ive done searches on the net and it seems that this should be possible. I just dont know why I cant get it to work. Maybe I am doing somethign wrong and someone may be able to point me in the right direction.

Thx again,

Brock

JP2112
02-11-2009, 12:12 PM
Either Vista or IE7 (I think IE7) introduced a new feature called "Protected Mode" which you need to turn off before trying to automate IE7. That is the report I am getting from other users trying to automate IE from VBA.

HTH



Hi Everyone,

After countless hours of trying to figure out how to do the basic automation of IE, I am stuck at a point in my code that I thought was straight forward.

I have scoured the internet, and the general conclusion is that I should be able to send the click command to request the page.

My code is below:

oIE.Document.all("ctl00$ContentPlaceHolder1$txtGamertag").Value = "username"
oIE.Document.all("ctl00$ContentPlaceHolder1$btnSearch").Click


The click doesnt work. If I were not using VBA, I could simply click enter on my keyboard or select the search icon on the page. I am stuck as to why I can not successfully submit the page in VBA.

Here is the snippet of the html that I believe has everything that I need. The thing that is throwing me off is that it appears there is a javascript that fires on keypress, but I dont know if that matters or not for my problem.

Any insight or direction you can give me will be much appreciated. Unless all else fails (which it probably will at the pace I am going with this) I should be all set.

Many, many, many thanks in advance,

Brock

P.S. Because I am new to this forum, apparently I cannot place links. Therefore, the site I am referring to is the Gears of War 2 webstats page for all of the video game players out there.