Discussion:
already open IE
(too old to reply)
g***@pnmac.com
2018-04-24 17:51:44 UTC
Permalink
i. I have the following, which makes my code go to the already open instance of IE to change values in select dropdowns.. but if there is more than 1 IE window open, it sometimes goes to the wrong window if i happen to click on another already opened IE window.. can someone tell me how i can add code to go to a SPECIFIC window and only that window? Sometimes the same website is open in more than 1 window.. so I am sure that complicates things even more... Here is my code so far..

'-------------------------------------------------------------------------------------------
'INTERACT WITH ALREADY OPEN ie
WScript.Sleep 4000 '1000 = 1 second


Dim oIE
Dim ShellApp
Set ShellApp = CreateObject("Shell.Application")
Dim ShellWindows
Set ShellWindows = ShellApp.Windows()
For Each ShellApp In ShellWindows
If UCase(ShellApp.FullName) = UCase("C:\Program Files (x86)\Internet Explorer\iexplore.exe") Then
If Left(UCase(ShellApp.LocationURL), Len("https://websiteNAME.html")) = UCase("https://websiteNAME.html") Then
Set oIE = ShellApp
End If
End If
Next


Do Until oIE.Busy = False
DoEvents
Loop




With oIE

...
Mayayana
2018-04-24 23:36:43 UTC
Permalink
<***@pnmac.com> wrote

|can someone tell me how i can add code to go to
| a SPECIFIC window and only that window?

Yes. Don't send 2 IE instances to the same URL.
If you can't arrange that then it's up to you. You
can look through the IE properties to see what might
be unique. But if they're both on the same page that
won't do you much good. In that case, why not just
close one?

As I said with your last question, you should get
the docs for IE and the DOM so that you can look
these things up.
JJ
2018-04-25 09:14:16 UTC
Permalink
Post by g***@pnmac.com
i. I have the following, which makes my code go to the already open
instance of IE to change values in select dropdowns..
I don't see any code that do exactly that.
Post by g***@pnmac.com
but if there is
more than 1 IE window open, it sometimes goes to the wrong window if i
happen to click on another already opened IE window..
Some input events need to be performed on the active window. So the
automation engine need to perform those events on the active window. If you
happen to interfere that process, inconsistent automation result is
expected.
Post by g***@pnmac.com
can someone tell me
how i can add code to go to a SPECIFIC window and only that window?
You already did manage to separate one from the other.
Post by g***@pnmac.com
Sometimes the same website is open in more than 1 window.. so I am sure
that complicates things even more... Here is my code so far..
I don't see any code that do just that either, so it's impossible to know
what went wrong.
Mayayana
2018-04-25 11:57:00 UTC
Permalink
"JJ" <***@vfemail.net> wrote

| I don't see any code that do just that either, so it's impossible to know
| what went wrong.

That's what he's asking. Unless I misunderstood,
he wants to know options for identifying specfific
IE instances that are both at the same website.
Even Hwnd and left, top probably wouldn't work
if he's using tabs. But the question also doesn't
seem to make sense. Why load the same page into
2 browser instances?

On the other hand, I'm getting the sense that
Mr. Bell doesn't really pay attention to posts. He
doesn't even respond directly to the person answering.
He just keeps asking until he figures it out.
JJ
2018-04-26 17:11:35 UTC
Permalink
Post by Mayayana
That's what he's asking. Unless I misunderstood,
he wants to know options for identifying specfific
IE instances that are both at the same website.
Even Hwnd and left, top probably wouldn't work
if he's using tabs. But the question also doesn't
seem to make sense. Why load the same page into
2 browser instances?
AFAIU, he doesn't intend to do that. He only want it to be loaded in one
window, but apparently the result he got is that the page is loaded on other
existing window too.

But as I said, the code which he provided, doesn't even have any which opens
a page. So, it's impossible to know what went wrong without knowing what his
code does.
Post by Mayayana
On the other hand, I'm getting the sense that
Mr. Bell doesn't really pay attention to posts. He
doesn't even respond directly to the person answering.
He just keeps asking until he figures it out.
Yes, I noticed that too.

Next time, I'll make him cross the river if he want my fish. >:-D
Loading...