I am trying to automate data input to a model of mine from PIMCO website for fund holding database.
Website:https://www.pimco.com/investments/mutual-funds/emerging-markets-bond-fund/inst
I need to extract the Holdings Report data (xls workbook) from the site.
My Code:
Set elements = HTMLDoc.getElementsByTagName("a")
For Each element In elements
If InStr(element.innerText, "Holdings Report") Then
hrefLink = element.href
IE.navigate hrefLink // This creates a new pop up and a message asking if the file must be saved/opened
Set wb = Workbooks.Open(element.href) // Throws an error
End If
Next
the webservice link(hrefLink above) being called on clicking the Holding Report button is
https://www.pimco.com/handlers/displaydocument.ashx?c=72201P522&wd=Holdings Report&fn=PIMCO Funds Emerging Markets Corp Bond Fund Portfolio Holdings 709.XLS&id=QRQg2jRnd9AJrFn%2fOA2Sp0xR09EkWc64pyAEuordzHsARqqpDYmvlBBcIgDokEeCM6cdWs55%2f4wk9gu2ywfEdow%2fMGHlPUWvKY1XdSZmKrA3dh%2f4%2fXZQYr0OIvF2X7n9DExITdx0FiH2Zif6g0MZzESHcGg%2fc8NNWJtiJJ5XM0xuLVVJAXKxIy3Ss94TpsWkZGjcOl%2fqh3hyYNFIRkz2BWGmp7Kb5UUYnPq%2b2wOMX8SlnWx0bj9CCaPaZaoIBhSMcvumJSEOqtmDJhAa%2f1FWPWyayrohG3C%2b5QsHRW7w8onfUCq08RkCaaRpDafTPDobAtrczfeMSCHldvK2S5dv6v39eWx358pDYNilnNnjDXv7al%2bfXyjglUYZFabL210V