Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Webqueries and variables problem


Hi,

I have a saved macro that queries the FT fund site to get some
financial data and it works great. however, as soon as I start to break
up the URL string and add my own variables to it, it stops working. Does
anyone know if I have to do something special to get this to work:

'Even with this small change it doesn't work where we are specifying
the day! -tried sDayGet as a string and a single

'With ActiveSheet.QueryTables.Add(Connection:= _
'
"URL;http://mwprices.ft.com/custom/ftfundcenter-com/html-fundsHistorical.asp?symb=F1%3AMGITA&countrycode=F1 %3AMGITA&mwHistDate="
*& sDayGet &* "%2F07%2F2005&x=19&y=12" _
' , Destination:=Range("E1"))
' .Name = _
'
"html-fundsHistorical.asp?symb=F1%3AMGITA&countrycode=F1 %3AMGITA&mwHistDate=29%2F07%2F2005&x=19&y=12"

'this works

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://mwprices.ft.com/custom/ftfundcenter-com/html-fundsHistorical.asp?symb=F1%3AMGITA&countrycode=F1 %3AMGITA&mwHistDate=29%2F07%2F2005&x=19&y=12"
_
, Destination:=Range("E1"))
..Name = _
"html-fundsHistorical.asp?symb=F1%3AMGITA&countrycode=F1 %3AMGITA&mwHistDate=29%2F07%2F2005&x=19&y=12"
..FieldNames = True
..RowNumbers = False
..FillAdjacentFormulas = False
..PreserveFormatting = False
..RefreshOnFileOpen = False
..BackgroundQuery = True
..RefreshStyle = xlInsertDeleteCells
..SavePassword = False
..SaveData = True
..AdjustColumnWidth = True
..RefreshPeriod = 0
..WebSelectionType = xlSpecifiedTables
..WebFormatting = xlWebFormattingRTF
..WebTables = "12"
..WebPreFormattedTextToColumns = True
..WebConsecutiveDelimitersAsOne = True
..WebSingleBlockTextImport = False
..WebDisableDateRecognition = False
..WebDisableRedirections = False
..Refresh BackgroundQuery:=False
End With
Range("B3").Select


--
dazman
------------------------------------------------------------------------
dazman's Profile: http://www.excelforum.com/member.php...o&userid=25903
View this thread: http://www.excelforum.com/showthread...hreadid=392878

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Webqueries and variables problem

This is a text string so
"ddddd"&yourvariable&"dddd"

--
Don Guillett
SalesAid Software

"dazman" wrote in
message ...

Hi,

I have a saved macro that queries the FT fund site to get some
financial data and it works great. however, as soon as I start to break
up the URL string and add my own variables to it, it stops working. Does
anyone know if I have to do something special to get this to work:

'Even with this small change it doesn't work where we are specifying
the day! -tried sDayGet as a string and a single

'With ActiveSheet.QueryTables.Add(Connection:= _
'

"URL;
http://mwprices.ft.com/custom/ftfund...Historical.asp
?symb=F1%3AMGITA&countrycode=F1%3AMGITA&mwHistDate ="
*& sDayGet &* "%2F07%2F2005&x=19&y=12" _
' , Destination:=Range("E1"))
' .Name = _
'

"html-fundsHistorical.asp?symb=F1%3AMGITA&countrycode=F1 %3AMGITA&mwHistDate=
29%2F07%2F2005&x=19&y=12"

'this works

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://mwprices.ft.com/custom/ftfund...Historical.asp
?symb=F1%3AMGITA&countrycode=F1%3AMGITA&mwHistDate =29%2F07%2F2005&x=19&y=12"
_
, Destination:=Range("E1"))
Name = _

"html-fundsHistorical.asp?symb=F1%3AMGITA&countrycode=F1 %3AMGITA&mwHistDate=
29%2F07%2F2005&x=19&y=12"
FieldNames = True
RowNumbers = False
FillAdjacentFormulas = False
PreserveFormatting = False
RefreshOnFileOpen = False
BackgroundQuery = True
RefreshStyle = xlInsertDeleteCells
SavePassword = False
SaveData = True
AdjustColumnWidth = True
RefreshPeriod = 0
WebSelectionType = xlSpecifiedTables
WebFormatting = xlWebFormattingRTF
WebTables = "12"
WebPreFormattedTextToColumns = True
WebConsecutiveDelimitersAsOne = True
WebSingleBlockTextImport = False
WebDisableDateRecognition = False
WebDisableRedirections = False
Refresh BackgroundQuery:=False
End With
Range("B3").Select


--
dazman
------------------------------------------------------------------------
dazman's Profile:

http://www.excelforum.com/member.php...o&userid=25903
View this thread: http://www.excelforum.com/showthread...hreadid=392878



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Webqueries and variables problem


thanks for the reply, but I think that's what I'm doing. Does anyon
know if you can dynamically change these static Excel Webqueries i
this way

--
dazma
-----------------------------------------------------------------------
dazman's Profile: http://www.excelforum.com/member.php...fo&userid=2590
View this thread: http://www.excelforum.com/showthread.php?threadid=39287

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
Table function, 2 variables. Problem with update/refresh lorenzo Excel Worksheet Functions 5 November 25th 06 10:55 PM
Webqueries and variables problem dazman Excel Discussion (Misc queries) 0 August 4th 05 10:31 AM
another look-up problem(three variables) mikey6704 Excel Programming 2 August 6th 04 09:06 PM


All times are GMT +1. The time now is 02:40 PM.

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

About Us

"It's about Microsoft Excel"