3

I'm working in VBA and creating Macros in Excel to send info to and from an IE browser window. I've been using AppActivate to focus on the certain IE page using it's title which has worked fine. Using SendKeys to send information back to the browser hasn't 100% gone that well so I've now started using...

Set ie = New InternetExplorer

ie.Navigate "http://url"

'Loop until ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop

ie.Visible = True

followed by code to populate various fields on a web form.

This all works really well now except that it is currently set to open a new browser window. I've been trying to change the code so it finds the IE window I'm using similarly to AppActivate. But I can't find a way of combining the two. Can anyone help please? How do I change.....

Set ie = New InternetExplorer

to

Set ie = IE WINDOW WITH THIS TITLE.... or something similar? 

Many thanks

Paul

paj
  • 59
  • 2
  • 3
  • 8

1 Answers1

1

Please read this link in order to get an IE window by its address

http://vba-corner.livejournal.com/4623.html

Here is another useful link

http://www.excely.com/excel-vba/ie-automation.shtml

Hope is helps

Uri Goren
  • 13,386
  • 6
  • 58
  • 110
  • Thank you for that. I've managed to do it now by exploring a few forums. I'm now using Dim ie As Object With CreateObject("Shell.Application").Windows etc which is working great. Thanks for the response – paj Feb 02 '12 at 15:19