Darrel Dolph
asked on
how to change url contents to variables
I want to download Google Mutual Fund historical data. This code snipit works fine:
With ActiveSheet.QueryTables.Ad d(Connecti on:= _
"URL;https://www.google.com/finance/historical?cid=298525784073028&startdate=Jun+26%2C+2016&enddate=Jun+22%2C+2017&num=200&ei=6GtRWbGxFNaO2AbylaCIBw", _
Destination:=Range("$A$3") )
But, I would like to change the cid code, startdate and enddate to variables but everything I try doesn't work. Example,
changing the cid code to a string:
id = 298525784073028
With ActiveSheet.QueryTables.Ad d(Connecti on:= _
"URL;https://www.google.com/finance/historical?cid=&id&&startdate=Jun+26%2C+2016&enddate=Jun+22%2C+2017&num=200&ei=6GtRWbGxFNaO2AbylaCIBw", _
Destination:=Range("$A$3") )
With ActiveSheet.QueryTables.Ad
"URL;https://www.google.com/finance/historical?cid=298525784073028&startdate=Jun+26%2C+2016&enddate=Jun+22%2C+2017&num=200&ei=6GtRWbGxFNaO2AbylaCIBw", _
Destination:=Range("$A$3")
But, I would like to change the cid code, startdate and enddate to variables but everything I try doesn't work. Example,
changing the cid code to a string:
id = 298525784073028
With ActiveSheet.QueryTables.Ad
"URL;https://www.google.com/finance/historical?cid=&id&&startdate=Jun+26%2C+2016&enddate=Jun+22%2C+2017&num=200&ei=6GtRWbGxFNaO2AbylaCIBw", _
Destination:=Range("$A$3")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have recommended this question be closed as follows:
Accept: ste5an (https:#a42203194)
If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
MacroShadow
Experts-Exchange Cleanup Volunteer