+ Reply to Thread
Results 1 to 2 of 2

Run Time Error

  1. #1
    Registered User
    Join Date
    03-29-2006
    Posts
    21

    Run Time Error

    Hi,

    Im getting a run time error 13 for the code below!! it says Type Mismatch.

    can anyone see why, i cant!!




    Sub getit()

    'use this once and then refresh
    myurl = "http://www.all-hotels.com/xbook/servlet/DisplayRates?show=&partner=8&hotl_id=162382&type=abook&filter=&splurgeUrl=yes&txtArrivalDate1=" + Sheets("Sheet2").Range("B11") + "&txtDepartureDate1=" + Sheets("Sheet2").Range("B12") + "&locationID=450210&hotel_name=&lastLocation=Farnborough&cboArrivalMonths=" + Sheets("Sheet2").Range("B19") + "&cboArrivalDays=10&cboNights=" + Sheets("Sheet2").Range("B20") + "&number_of_adults1=2&number_of_children1=0&number_of_beds1=1"






    With ActiveWorkbook.Worksheets("test").QueryTables.Add(Connection:="URL;" & myurl, Destination:=Worksheets("test").Cells(1, 1))

    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlInsertDeleteCells
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .WebPreFormattedTextToColumns = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
    End With
    End Sub

  2. #2
    Tom Ogilvy
    Guest

    RE: Run Time Error

    Try changine the "+" sign to "&"

    --
    Regards,
    Tom Ogilvy


    "gunny1979" wrote:

    >
    > Hi,
    >
    > Im getting a run time error 13 for the code below!! it says Type
    > Mismatch.
    >
    > can anyone see why, i cant!!
    >
    >
    >
    >
    > Sub getit()
    >
    > 'use this once and then refresh
    > myurl =
    > "http://www.all-hotels.com/xbook/servlet/DisplayRates?show=&partner=8&hotl_id=162382&type=abook&filter=&splurgeUrl=yes&txtArrivalDate1="
    > + Sheets("Sheet2").Range("B11") + "&txtDepartureDate1=" +
    > Sheets("Sheet2").Range("B12") +
    > "&locationID=450210&hotel_name=&lastLocation=Farnborough&cboArrivalMonths="
    > + Sheets("Sheet2").Range("B19") + "&cboArrivalDays=10&cboNights=" +
    > Sheets("Sheet2").Range("B20") +
    > "&number_of_adults1=2&number_of_children1=0&number_of_beds1=1"
    >
    >
    >
    >
    >
    >
    > With
    > ActiveWorkbook.Worksheets("test").QueryTables.Add(Connection:="URL;" &
    > myurl, Destination:=Worksheets("test").Cells(1, 1))
    >
    > .FieldNames = True
    > .RowNumbers = False
    > .FillAdjacentFormulas = False
    > .PreserveFormatting = True
    > .RefreshOnFileOpen = False
    > .BackgroundQuery = True
    > .RefreshStyle = xlInsertDeleteCells
    > .SaveData = True
    > .AdjustColumnWidth = True
    > .RefreshPeriod = 0
    > .WebPreFormattedTextToColumns = True
    > .WebSingleBlockTextImport = False
    > .WebDisableDateRecognition = False
    > .WebDisableRedirections = False
    > .Refresh BackgroundQuery:=False
    > End With
    > End Sub
    >
    >
    > --
    > gunny1979
    > ------------------------------------------------------------------------
    > gunny1979's Profile: http://www.excelforum.com/member.php...o&userid=32932
    > View this thread: http://www.excelforum.com/showthread...hreadid=528666
    >
    >


+ 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