
Originally Posted by
msy12
I currently use this macro to open the specific website and login (which I got from this forum and it works perfectly!! - as long as you enable/Reference Microsoft XML v4.0)
However...I would like to write another macro to extract information from this already opened webpage.
I can't "CreateObject" again, because I'd have to login all over again...
How could I start a macro, to reference the already opened webpage?
Have a search for ShellWindows (or Shell.Windows) which is a collection of windows, including all open IE windows and tabs.
But why do you need a separate macro to pick up the already opened web page? Why not continue your existing macro, where the 'ie' variable is already referencing the IE browser open at your web site? The 'Click' method generates a navigate event, so you need to wait for the new page to load, using the same 'wait' code as shown earlier:
And then 'ie.document' references the logged in page.
Once I have logged in...the webpage is a 'search' screen. I have to search different 'cases' for specific bits of information.
So would I continue to use ie.document.all.Item("txtUserName").Value to fill in different fields, like the case number?
Yes, using the appropriate HTML element id or name attribute (txtUserName in your example).
Once the 'case' screen is opened...
what Code would I use to actually Extract information from the different fields?
Usually the same as filling in fields, by referencing the HTML id or name of the field, except put the reference on the right-hand side of the equals sign, like this:
Bookmarks