I'm using the following code to grab an image (of a part held on a SharePoint site) to display in an excel sheet. I'd like to use the user's own Active Directory credentials to access the url. The code I've got so far is:
Dim Request As Object
Dim ResponseStatus As Variant
Dim ImgURL As String
ImgURL = "https://someValidURL/" & ExtraPartNo & ".jpg"
Set Request = CreateObject("WinHttp.WinHttpRequest.5.1")
.Open "GET", ImgURL, True
ResponseStatus = .StatusText
Set Request = Nothing
If ResponseStatus = "OK" Then
ImgURL = "https://someValidURL/" & ExrtaPartNo & ".jpg"
SetterImgURL = "https://someValidURL/AwaitingImage.jpg"
The idea is to display an image of a part if it exists but if it doesn't then display the AwaitingImage.jpg