From time to time the code posted here fails to work due to changes to the page layout on Yahoo Finance. This has now been updated by replacing .WebTables = "16" with .WebTables = "15".
The best solution is the download file as it does not rely on the layout but rather finds the price data wherever it resides on the page. There are also many other enhancements and advantages with this solution.