Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 22nd, 2003, 06:19 PM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Downloading data from Web into Excel

Hi,

HiBelow is an example of a dummy web site that I want to connect to and download the data. What I want to do is execute that code in a loop, increasing the highlighted number by 1. So next time I call the web site the number is 11, then 12, 13, 14 and so on. What is the best way to achieve this?


With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://www.abc.com/rates.cfm?action=view&RateCode=10" _
        , Destination:=Range("A1"))
        .Name = _
        "rates.cfm?action=view&RateCode=10"

Thank you for your help in advance.

Regards,
Blase

 
Old October 23rd, 2003, 02:34 AM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Something like this should do the trick:

Dim i As Integer
Dim strURL As String, strSettings As String, strConnection As String, strName As String

strURL = "http://www.abc.com/"
strSettings = ""rates.cfm?action=view&RateCode="

For i = 10 to 20
   strConnection = "URL;" & strURL & strSettings & i
   strName = strSettings & i
   With ActiveSheet.QueryTables.Add(Connection:= strConnection, Destination:=Range("A1"))
      .Name = strName
   End With
Next i
 
Old October 24th, 2003, 09:00 AM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

:)

Thank you, I will give it a go






Similar Threads
Thread Thread Starter Forum Replies Last Post
Downloading Excel File [email protected] VB How-To 0 October 28th, 2004 11:40 AM
Issue of downloading Excel file(resent) zuolinbai Classic ASP Basics 1 June 10th, 2004 05:24 PM
Issue of downloading Excel file zuolinbai Classic ASP Professional 1 June 7th, 2004 05:50 PM
Problem when downloading web service??? joan .NET Web Services 2 May 16th, 2004 06:39 AM
merging data from web form to excel spreadsheet fmh002 Classic ASP Basics 1 June 30th, 2003 04:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.