+ Reply to Thread
Results 1 to 3 of 3

Excel Web query - I can only get max. 9 queries from my macro

  1. #1
    Registered User
    Join Date
    09-29-2008
    Location
    Toronto, Canada
    Posts
    14

    Excel Web query - I can only get max. 9 queries from my macro

    I'm trying to create a macro that needs to get info from about 500 different web pages. After the 9th page it will not allow me to query it. I get error '1004' and the following message: 'Unable to open (website address). Cannot download the information requested.

    Sometimes this happens after the 7th page. But mostly after the 9th.
    I am using a Do Loop to query through the different pages.

    If anyone can help thanks,
    Last edited by pfrattali; 12-14-2010 at 02:39 PM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Excel Web query - I can only get max. 9 queries from my macro

    You'll need to post enough of your code for us to see what's happening.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    09-29-2008
    Location
    Toronto, Canada
    Posts
    14

    Re: Excel Web query - I can only get max. 9 queries from my macro

    Quote Originally Posted by Ron Coderre View Post
    You'll need to post enough of your code for us to see what's happening.
    (actually, I'm using a DO LOOP )
    The website that I query needs a password login, which I need to do through Excel 'new web query'.


    Here is the subroutine that queries:


    Public Sub QueryW(gal, reg, sys)
    '
    ' Query Webpage Macro
    ' the following web pages need to be queried:
    ' 'http://epsilon.astroempires.com/map.aspx?loc=E29:54:00 to
    ' http://epsilon.astroempires.com/map.aspx?loc=E29:54:20
    '

    With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;http://epsilon.astroempires.com/map.aspx?loc=E" + gal + ":" + reg + ":" + sys, Destination:= _
    Range("$B$4"))
    .Name = "Test"
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = False
    .RefreshOnFileOpen = False
    .BackgroundQuery = False
    .RefreshStyle = xlOverwriteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = False
    .RefreshPeriod = 0
    .WebSelectionType = xlEntirePage
    .WebFormatting = xlWebFormattingNone
    .WebPreFormattedTextToColumns = True
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = True
    .Refresh BackgroundQuery:=False

    End With



    End Sub




    Here is the main part of the macro program:


    Sub ListCoordinates()
    ' list all map cordinates for server from AE website


    Dim gal As String, reg As String, sys As String, ast As String
    Dim g As Integer, r As Integer, s As Integer, a As Integer





    gal = "29"

    reg = "54"

    s = -1


    Do While s < 20



    s = s + 1


    sys = Mid(Str(Val(s)), 2, 2): If Len(sys) = 1 Then sys = "0" + sys
    'ast = ""



    Call QueryW(gal, reg, sys)


    Loop




    End Sub
    Last edited by pfrattali; 12-14-2010 at 02:50 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1