ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get a reference to the currently running IE ? (https://www.excelbanter.com/excel-programming/320335-get-reference-currently-running-ie.html)

quartz[_2_]

Get a reference to the currently running IE ?
 
I know that to create a new instance of IE, I can use:

Dim oIE As InternetExplorer
Set oIE = New InternetExplorer

How does one get a reference to the current instance? I tried "GetObject"
but I must be doing something wrong. I won't post since it fails anyway.

Thanks in advance.

CodeSponge[_2_]

Get a reference to the currently running IE ?
 
What type of Ref?

if u want the value of a form field or something like that its
oIE.Document.formName("fieldName").value

if u want the body source to parse then try
sVar = oIE.Document.Body.innerhtml


etc...


quartz[_2_]

Get a reference to the currently running IE ?
 
I thought my original post was clear, but I meant to ref the currently
running IE application itself...can you help me out?

"CodeSponge" wrote:

What type of Ref?

if u want the value of a form field or something like that its
oIE.Document.formName("fieldName").value

if u want the body source to parse then try
sVar = oIE.Document.Body.innerhtml


etc...



CodeSponge[_2_]

Get a reference to the currently running IE ?
 
O, ic, sorry about that.
you could try something like the following


Public Declare Function FindWindow& Lib "user32" Alias "FindWindowA"
(ByVal lpClassName$, ByVal lpWindowName$)

and then call it like this

hMessageBox = FindWindow("#32770", "WindowName")

I this is what I do when I want to grab a msg box and kill it.
I'm not sure what the lpClassName for IE would be tho
hope it helps.



All times are GMT +1. The time now is 12:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com