Sub CreateNewQuery() p355 VBA and Macros for Microsoft Excel

  • Thread starter Thread starter ExcelQuant
  • Start date Start date
E

ExcelQuant

Guest
I've been using the sub for over a year with no problem to download security prices to Excel.

The routine no longer works.
The symbols are updated ok, but price data is not downloaded to the "portfolio" and "workspace" sheets.

Has Yahoo changed their table structure?
What changes need to be made to the sub?

Thanks
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Yes, Yahoo has changed their layout - which they do often.

For now - find the line:
Code:
 .WebTables = "20"
and change it to
Code:
        .WebTables = "14"

in the future, what you can do is go the the Workspace sheet, manually edit the query (Data, Import External Query, Edit Query) and see what table is checked. if it's the proper table - then the problem is elsewhere. If it's not, then you need to find the proper table and modify the code accordingly.
 
Thank you so much. I should have contacted you three days ago.
It would have saved me the work of creating symbol strings for manual
links to the data which I then exported to Excel. That worked OK for stocks with uniques symbols, although it was obviously brute force.

On the other hand, I created options valuations model in which the option symbol is dynamically constructed based on code tables for option type ("put" or "call"), expiration month and exercise price. There wa no way I could do the downloads manually.

Again, thanks for your help. This site is a goldmine.

ExcelQuant
 

Forum statistics

Threads
1,222,697
Messages
6,167,702
Members
452,132
Latest member
Steve T

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top