** Pulling Data From Pop Up Internet Window **

brad7989

New Member
Joined
Aug 1, 2011
Messages
45
So I'm trying to automate data pulling... To get the data I want I have to go to a page, log in, then click a link, which opens a popup window... I then download the data from there as an excel file.

A couple of questions:

1) How do I get it to pull data off a pop-up window?

2) How do I streamline my data-pulling that comes into a separate Excel Sheet into my Excel workbook? I was thinking I could have it save as the same name everytime I do a different download it will just overwrite and then copy and paste the new info into a new tab in my workbook.

Some other background:

I have a formatting macro that cycles through quite a few different tabs to format them. I currently have to manually download all of the data files, then manually combine them into one workbook, then run my macro.

Thanks for your help!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
1) How do I get it to pull data off a pop-up window?
If it's an IE window, find the window by looping through Shell.Windows, or use InternetExplorer WithEvents and get the pop-up window via the NewWindow2 event.
 
Upvote 0
Wow thanks. I don't know how either of those work... I'll try looking into that unless you have an example code.

Thanks again,

Brad
 
Upvote 0
The WithEvents technique is explained here - http://visualbasic.about.com/od/standalonevb6/l/blnewieinstance.htm.

Shell.Windows example code:

Code:
Private Function Get_IE_Window() As Object

    'Look for an IE browser window and, if found, return that browser as an InternetExplorer object.  Otherwise return Nothing

    Dim Shell As Object
    Dim IE As Object
    Dim i As Variant 'Integer
    
    Set Shell = CreateObject("Shell.Application")
    
    i = 0
    Set Get_IE_Window = Nothing
    While i < Shell.Windows.Count And Get_IE_Window Is Nothing
        Set IE = Shell.Windows.Item(i)
        If Not IE Is Nothing Then
            If TypeName(IE.Document) = "HTMLDocument" Then
                Set Get_IE_Window = IE
            End If
        End If
        i = i + 1
    Wend
    
End Function
You'll probably need to check IE.LocationName or IE.LocationURL, etc. after the TypeName statement to see if that IE window is your IE pop-up window.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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