S
slimswol
Hello,
I have looked everywhere and I cannot seem to get an example to fin
out what I am doing wrong. I need to create a web query within a macr
for Excel. The web query will return results from a form which has
fields:
Field 1: Status
Field 2: BeginDate
Field 3: EndDate
I will be entering the status parameter manually into the url, but th
dates need to be in the format (yyyy-mm-dd) and both fields need t
have today's date. It sounds simple, but I can't seem to get it t
work. Here is some code which is very simular to what I have:
Sub URL_Query()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://mywebsite.com/abc?name=volform¶ms=srgEd&status=Open&BeginDate=
& Format(Now(), "yyyy-mm-dd") & EndDate=" & Format(Now()
"yyyy-mm-dd")", _
Destination:=Range("a1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub
Any help on this would be greatly appreciated!
Thank
I have looked everywhere and I cannot seem to get an example to fin
out what I am doing wrong. I need to create a web query within a macr
for Excel. The web query will return results from a form which has
fields:
Field 1: Status
Field 2: BeginDate
Field 3: EndDate
I will be entering the status parameter manually into the url, but th
dates need to be in the format (yyyy-mm-dd) and both fields need t
have today's date. It sounds simple, but I can't seem to get it t
work. Here is some code which is very simular to what I have:
Sub URL_Query()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://mywebsite.com/abc?name=volform¶ms=srgEd&status=Open&BeginDate=
& Format(Now(), "yyyy-mm-dd") & EndDate=" & Format(Now()
"yyyy-mm-dd")", _
Destination:=Range("a1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub
Any help on this would be greatly appreciated!
Thank