Solved: excel2003 macro; workbooks.open problem

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

balloon_tom

Thread Starter
Joined
Jan 4, 2006
Messages
107
Good evening all. I'm a newby so please bear with me.
I am using Excel 2003 Pro; XP Pro; broadband.
I am writing a macro to download weather information from several websites into individual spreadsheets. All but one work perfectly.
The one in question: workbooks.open ("http://www.MYAFD.com/airport/lhz") comes up with a login box named: "Connect to www.myafd.com" requesting user name and password. 1) Pressing ESC, 2) 4 tabs to Cancel then Enter, or 3) clicking on Cancel, all clear the login box and allows the website to continue opening as a spreadsheet. I would like the macro to clear this login box automatically (or connect in such a way that it does not come up in the first place).
This login box is NOT encountered when accessing this wesite directly through IE6.
Thank you,
Tom
 

balloon_tom

Thread Starter
Joined
Jan 4, 2006
Messages
107
Thanks Zack,
Maybe a little help...I did not have the InternetExplorer reference checked but I don't know if that makes a big difference. The navagate command:
ie.Navigate "http://www.myafd.com/airport/lhz"
does open the webpage without the login prompt...this is good. Now how do I copy the open page to a new excel workbook? Once again, using the 'workbooks.open' command brings up the login box which is what I am trying to avoid.
Tom
 

balloon_tom

Thread Starter
Joined
Jan 4, 2006
Messages
107
I think I have the problem solved. I removed the workbooks.open method and replaced it with:

Workbooks.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"URL:http://www.MYAFD.com/airport/lhz", Destination:=Range("a1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = False
End With

Thanks for the direction!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top