LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default web query in VBA (format dates in url)


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=volfor...n&BeginDat e=
& 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

--
slimswo
-----------------------------------------------------------------------
slimswol's Profile: http://www.excelforum.com/member.php...fo&userid=3201
View this thread: http://www.excelforum.com/showthread.php?threadid=51756

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query equasion for dates Dave Excel Worksheet Functions 8 January 10th 08 03:53 PM
Group Dates from SQL Query wjvii Excel Discussion (Misc queries) 1 March 22nd 07 11:52 PM
Format text 'dates' to real dates Jacy Excel Worksheet Functions 4 July 24th 06 02:10 AM
the dates on cell format make different dates. date formats morph the dates/chang case New Users to Excel 6 April 18th 05 02:41 AM
dates in query patrick @fizz Excel Worksheet Functions 0 April 8th 05 07:43 PM


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"