Hello - I am using existing VBA in Access 2007 to download a file from IE. This code has been working perfectly for a few years. Recently, the website changed their source and now the file is not always in the same location. It is now in a table and I can't figure out how to get the tag for the proper file.
The file is no longer always associated with the same tag; some days it is (1) and some days it is (0) and some days it is (2) and so on. I always need the csv file.
Below is the section of the code that had been working but needs changed. I am not able to provide the login to the site as the information is confidential. However, I have included attachments with what the webpage looks like and the source. Hopefully, this provides enough information. I have highlighted the file I need.
I am a beginner in VBA and didn't write this original code, so I need a lot of help writing the code.
Set hdoc = IE.Document.frames(1).Document '.frames(1).Document '.Table(0).Document '.body.Document.frames(0).Document.Table(0).Document
Set linkCol = hdoc.all.tags("a")
tm = 0
str = "RateSheetGrid_View_0"
For Each link In linkCol
If InStr(link.ID, str) > 0 Then
rng = Left(rng, InStr(rng, ");") - 1)
urlXls = "https://www.stmpartners.com/Private/ResourceCenter/FileViewer.asp?FileID=" & rng