Link to home
Start Free TrialLog in
Avatar of Darrel Dolph
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.Add(Connection:= _
         "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.Add(Connection:= _
         "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
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

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