D
dazman
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/ftfun...ymb=F1:MGITA&countrycode=F1:MGITA&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/ftfun...code=F1:MGITA&mwHistDate=29/07/2005&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
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/ftfun...ymb=F1:MGITA&countrycode=F1:MGITA&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/ftfun...code=F1:MGITA&mwHistDate=29/07/2005&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