How do you get the IE object when you have the Window handle

bobkuhn

New Member
Joined
Nov 1, 2011
Messages
22
I'm trying to use Excel 2010 VBA to download tables from an Internet Explorer application. I've gotten to where the IE download manager pops up a window saying "Do you want to open or save xxxx from xxxx?" with the OPEN SAVE and CANCEL buttons. I haven't been able to get beyond this popup.

I think the solution is to examine the HTML of the window and use the usual IE object methods to click the button I want.

I can get the handle of the popup window but I don't know how to get the object for that window.

I used "PAT or JK's API SPY 5.1" to generate the following and to verify that it returns the correct handle.
Code:
    Dim ieframe As Long, framenotificationbar As Long, directuihwnd As Long, popup_handle as long
    ieframe = FindWindow("ieframe", vbNullString)
    framenotificationbar = FindWindowEx(ieframe, 0&, "frame notification bar", vbNullString)
    directuihwnd = FindWindowEx(framenotificationbar, 0&, "directuihwnd", vbNullString)
    popup_handle = directuihwnd

I'm also pretty sure that there are no child windows of the popup. The only solution I found (to handling the download manager popup) wanted to send mouse clicks to the child window OPEN.

I'm running IE 10.

Bob
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,223,098
Messages
6,170,100
Members
452,301
Latest member
QualityAssurance

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top