Results 1 to 12 of 12

2003 Macro is not running fine in 2010 why?

Threaded View

  1. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: 2003 Macro is not running fine in 2010 why?

    I have tested it in excel 2010 and it works.
    Yes, it is not returning a table. As I said, the site might have changed.

    You need to get rid of naming your sheet with index nos. The error is more unlikely to be connecting to the site.

    Sub Macro2()
    a = 1
    
    While Sheets("Sheet1").Cells(a, 1) <> ""
        urladdress = "URL;" & Sheets("Sheet1").Cells(a, 1).Text
        
        With ActiveSheet.QueryTables.Add(Connection:= _
            urladdress, Destination:=Range( _
            "$A$1"))
            .Name = Right(Sheets(1).Cells(a, 1).Value, 80)
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .WebSelectionType = xlEntirePage
            .WebFormatting = xlWebFormattingNone
            '.WebTables = "1,""wedstrijdTable2"""
            .WebPreFormattedTextToColumns = True
            .WebConsecutiveDelimitersAsOne = True
            .WebSingleBlockTextImport = False
            .WebDisableDateRecognition = False
            .WebDisableRedirections = False
            .Refresh BackgroundQuery:=False
        End With
    Range("a26").Copy Sheets(2).Cells(a, 1)
    Range("b26").Copy Sheets(2).Cells(a, 2)
    Range("a27").Copy Sheets(2).Cells(a, 3)
    Range("b27").Copy Sheets(2).Cells(a, 4)
    Range("a28").Copy Sheets(2).Cells(a, 5)
    Range("b28").Copy Sheets(2).Cells(a, 6)
    Range("a29").Copy Sheets(2).Cells(a, 7)
    Range("b29").Copy Sheets(2).Cells(a, 8)
    Range("a30").Copy Sheets(2).Cells(a, 9)
    Range("b30").Copy Sheets(2).Cells(a, 10)
    Range("a31").Copy Sheets(2).Cells(a, 11)
    Range("b31").Copy Sheets(2).Cells(a, 12)
    Range("a32").Copy Sheets(2).Cells(a, 13)
    Range("b32").Copy Sheets(2).Cells(a, 14)
    Range("a33").Copy Sheets(2).Cells(a, 15)
    Range("b33").Copy Sheets(2).Cells(a, 16)
    Range("a34").Copy Sheets(2).Cells(a, 17)
    Range("b34").Copy Sheets(2).Cells(a, 18)
    Range("a35").Copy Sheets(2).Cells(a, 19)
    Range("b35").Copy Sheets(2).Cells(a, 20)
    Range("a36").Copy Sheets(2).Cells(a, 21)
    Range("b36").Copy Sheets(2).Cells(a, 22)
    Range("a37").Copy Sheets(2).Cells(a, 23)
    Range("b37").Copy Sheets(2).Cells(a, 24)
    Range("a38").Copy Sheets(2).Cells(a, 25)
    Range("b38").Copy Sheets(2).Cells(a, 26)
    Range("a39").Copy Sheets(2).Cells(a, 27)
    Range("b39").Copy Sheets(2).Cells(a, 28)
    Range("a40").Copy Sheets(2).Cells(a, 29)
    Range("b40").Copy Sheets(2).Cells(a, 30)
    Range("a41").Copy Sheets(2).Cells(a, 31)
    Range("b41").Copy Sheets(2).Cells(a, 32)
    Range("a42").Copy Sheets(2).Cells(a, 33)
    Range("b42").Copy Sheets(2).Cells(a, 34)
    Range("a43").Copy Sheets(2).Cells(a, 35)
    Range("b43").Copy Sheets(2).Cells(a, 36)
    Range("a44").Copy Sheets(2).Cells(a, 37)
    Range("b44").Copy Sheets(2).Cells(a, 38)
    Range("a45").Copy Sheets(2).Cells(a, 39)
    Range("b45").Copy Sheets(2).Cells(a, 40)
    a = a + 1
    Sheets("Sheet1").Cells.ClearContents
    Wend
    End Sub
    Last edited by AB33; 09-08-2016 at 04:59 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] CheckBoxes.Add Works fine in 2010 but not 2007 or 2003
    By Jakeman92 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-18-2013, 05:17 AM
  2. [SOLVED] Advanced Filter Macro does not work, running manually works fine
    By jamiemc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2013, 07:22 PM
  3. Project with AddIn runs fine in Excel 2000, 2003 and 2007...2010 crashes
    By jaslake in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-27-2013, 10:10 AM
  4. Macro works fine in 2010, Crashing in 2003 - Posting problem code - Please Help?
    By RDAmidwest in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2012, 04:14 PM
  5. Macro works fine in Excel 2003 but not in 2007
    By jackdebnam in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2011, 12:00 PM
  6. Replies: 0
    Last Post: 07-27-2010, 12:49 AM
  7. Excel 97 not running macro that runs fine in 2000
    By Rich J in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2006, 02:50 PM
  8. Loop in my macro doesn't seem to be running; however, it compiles fine...
    By Goobies in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-01-2006, 09:00 PM

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