Have an Excel file at this location: https://ufr.osd.state.ma.us/DM/GetDoc.aspx?DocId=165350&Library=EFILEDMProd
You can see there's a hyperlink titled "Download" at the top. Need to automate the saving of this file using VBA in Excel through Internet Explorer 11 on a 64-bit machine. Ideally, I'd also like to save the file in a specific path and with a specific file name ("2018-042389332.xls", in this case). Trouble is that I cannot find a way to direct download the file, so I'm left to deal with the File Save dialog box that is tricky to interact with. So far I've tried using SendKeys with inconsistent results.
Here's the relevant part of the code I'm using. So far it works to click on the "Download" button, pulls up the File Save dialog at the bottom, and in some instances, follows through with saving the file as the default file name.
IE.Document.getElementById("LinkButton2").Click
SendKeys "{F6}", True
SendKeys "{TAB}", True
SendKeys "{DOWN}", True
SendKeys "{DOWN}", True
SendKeys "{ENTER}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{ENTER}", True