Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Programaticaly update webquery - help

Hi,

I would like to be able to programaticaly change some of the parameters
in an webquery. For example if I have a webquery that uses
www.somesite.com?day=1&month=2, when I access my workbook the next day
and refresh the data it will load the previous days data. So I need some
way to change the parameters of the query to
http://www.somesite.com?day=(=date.d...date.mont h);

Could someone point me to a website that might explain how to program
access to do this automatically when the workbook is opened?

Thank you
Paul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Programaticaly update webquery - help

something like this:

dayoftoday= day(date)
monthoftoday=month(date)
ConnectString = "URL;www.somesite.com?day=" & dayoftoday & "&month=" &
monthoftoday

' Define a new Web Query
Set QT = ActiveSheet.QueryTables.Add(Connection:=ConnectStr ing,
Destination:=activesheet.Range("A1"))
With QT
.Name = MyName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingAll
.WebTables = "7"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
End With

hope it helps...

"Paul" kirjoitti:

Hi,

I would like to be able to programaticaly change some of the parameters
in an webquery. For example if I have a webquery that uses
www.somesite.com?day=1&month=2, when I access my workbook the next day
and refresh the data it will load the previous days data. So I need some
way to change the parameters of the query to
http://www.somesite.com?day=(=date.d...date.mont h);

Could someone point me to a website that might explain how to program
access to do this automatically when the workbook is opened?

Thank you
Paul


Reply
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
Webquery Neale Excel Worksheet Functions 3 August 25th 08 05:26 PM
Webquery Othello Excel Discussion (Misc queries) 0 December 1st 04 12:41 PM
Read excel data programaticaly in C/C++ William Mischel Excel Programming 1 August 31st 04 01:16 PM
How to disconnect when WebQuery done Nathan Gutman Excel Programming 4 December 24th 03 03:31 PM
Using Webquery via VBA Richard Winston Excel Programming 3 December 2nd 03 12:50 PM


All times are GMT +1. The time now is 12:46 PM.

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"