Web Query

klatlap

Well-known Member
Joined
Sep 1, 2004
Messages
607
Office Version
  1. 2013
Platform
  1. Windows
Hi,

I am using excel 2010 web query to import pages so i can extract data.

I am having an issue where i can't get a particular bit of data to stay in the same format as it is displayed on the web.

Here is the page http://formguide.cyberhorse.com.au/...tml?formdate=2011-07-19&track=GeeSyn&raceno=3

If you look at the page it is horse race form, now what i need is for the "Distance" , "Tack", "Slow" and "heavy" to stay in the same format, sometimes it does but other times it converts it to a date and time, any help on this would be great thanks.

here is the current import macro i have

Code:
Sub test()
Sheets("Sheet1").Select
    Sheets("Sheet1").Range("A1:I1000").Select
    Selection.ClearContents
    With Sheets("Sheet1").QueryTables.Add(Connection:= _
        "URL;" & Sheets("Data").Range("A1"), Destination:=Sheets("Sheet1").Range("$A$1"))
        .Name = False
        .FieldNames = False
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = False
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlOverwriteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .Refresh BackgroundQuery:=False
    End With
    End Sub
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
before you run the web query format all the cells as text

then in your with statement include the following line at the bottom:

.WebDisableDateRecognition = True

Joe
 
Upvote 0
I am still having the same issues, does any one have a solution.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,258
Members
452,901
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top