Buggington
New Member
- Joined
- Mar 28, 2014
- Messages
- 8
Hello - first post here
I'm a VBA newbie and haven't really started with the easiest project! I'm trying to pull some data out of a website using a VBA macro and would like it to use an existing IE window (as it requires user intevention to find the correct page in the first place - this will change each time the script is run).
I've been doing some research and the best solution I've been able to find so far is this, which I've copied word for word.
I haven't started customising it for my own use yet, but when I try to step through it I get runtime error 438 when it hits the following line:
Any ideas what might be causing this?
Thanks
I'm a VBA newbie and haven't really started with the easiest project! I'm trying to pull some data out of a website using a VBA macro and would like it to use an existing IE window (as it requires user intevention to find the correct page in the first place - this will change each time the script is run).
I've been doing some research and the best solution I've been able to find so far is this, which I've copied word for word.
Code:
Sub FindTicketWindow()
'loop through each window
For Each wd In CreateObject("Shell.Application").Windows
'test it
If wd = "Windows Internet Explorer" Then
If InStr(UCase(wd.Document.Title), "Yahoo") <> 0 Then
'rejoice, found it!
Exit For
End If
End If
Next wd
wd.Navigate "[URL="http://www.google.com"]Google[/URL]"
End Sub
I haven't started customising it for my own use yet, but when I try to step through it I get runtime error 438 when it hits the following line:
Code:
If InStr(UCase(wd.Document.Title), "Yahoo") <> 0 Then
Any ideas what might be causing this?
Thanks