Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find and use Open Browser
Hello all,
I have a macro that opens internet explorer and directs the browser to an internet-based reference set using data I selected on my worksheet as the search criteria. The sub ends when that is complete, leaving the screen on the brower. At that point, I usually read the reference material, then go back to my worksheet, and continue working without closing the brower. Next time I need to use my macro to start a new search, sub will open a NEW browser and start the process again, leaving two windows with Internet explorer open with two different search results. Although this is "okay" I would really love it if the macro would find the original browser it opened and use it to start a new search. Is this possible? Below is the portion of my current code to accomplish what I described above. (The error is in case I don't have an internet connection and the sub goes to a "plan b". ******** CurrentBook = ActiveWorkbook.Name ActiveCell.Name = "ClassCode" Dim ipf As Object Set ie = CreateObject("InternetExplorer.Application") With ie .Visible = True .Navigate ("http://intranet address/page.html") ' Loop until the page is fully loaded Do Until .ReadyState = 4 DoEvents Loop On Error GoTo error1 Set ipf = ie.document.form1("text1") ipf.Value = Range("DATATOSEARCH").Value ie.document.all.Item("Submit1").Click Exit Sub End With error1: Dim CCode As New DataObject Dim MyAppID ie.Application.Quit ******** Any help on this would be awesome! I'm a VBA newbie, and most of what I have learned has been from this site, borrowing code the tweaking it with lots of trial and error! Bottom line: Don't assume that I know anything! Thanks in advance for your help! Tom |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open Excel not in a browser | Excel Discussion (Misc queries) | |||
excel can not open on some IE browser | Excel Discussion (Misc queries) | |||
VBA to open in different browser | Excel Programming | |||
Open Browser Maximized | Excel Programming | |||
Open Hyperlinks at the same browser | Excel Worksheet Functions |