Hi,
There are a series of reports that I need to download. I'm given a list of reference numbers that happen to be used when downloading my report.
Example:
Reference#: 348956
URL to download: https://www.domain.com/OpenReport.aspx/GID=348956
Since the majority of the URL is static, I used the concatenate function to build the URL
I found that when I write VBA refence the cell with the url, it will open as expected, but I'm presented with a login screen for the application where I get my report.
On the other hand, if I copy and pasted the URL into chrome, it would download the file with no issue. I figure the method VBA uses to open the URL is causing the login screen to display first.
Once I know I can get over this hurdle, I will write a for loop to get each cell in the column. Here is what I wrote just to test if I could open the link I generated
There are a series of reports that I need to download. I'm given a list of reference numbers that happen to be used when downloading my report.
Example:
Reference#: 348956
URL to download: https://www.domain.com/OpenReport.aspx/GID=348956
Since the majority of the URL is static, I used the concatenate function to build the URL
I found that when I write VBA refence the cell with the url, it will open as expected, but I'm presented with a login screen for the application where I get my report.
On the other hand, if I copy and pasted the URL into chrome, it would download the file with no issue. I figure the method VBA uses to open the URL is causing the login screen to display first.
Once I know I can get over this hurdle, I will write a for loop to get each cell in the column. Here is what I wrote just to test if I could open the link I generated
VBA Code:
Sub Report_Link
Dim URL As String
Dim RefID As String
RefID = ActiveCell.Value
URL = "https://www.domain.com/OpenReport.aspx/GID=" & RefID
ActiveWorkbook.FollowHyperlink URL
End Sub