shahin
Active Member
Sorry to have delayed Marc L, to answer your question. I missed the party. However, what i see in the web browser when I manually run row #14 url is: "http://www.unisalento.it/web/guest/home_page"
Hi ,Well said. Then you should think off those who like to pilfer other's code and manipulate that. A purist coder doesn't imitate other's code rather he makes that himself anew. I didn't tell you anything out of hypothesis. It's fact. Anyways, you didn't get your question answered yet only because you were not explicit enough about what you really wanted in the first place. Thanks.
Where is the code in your initial post ?‼I just asked for a small change to an existing code. I do not think it's so difficult for anyone who knows the macro language ...
Also check exact result with the one of this row #14 …
As I do not know how to produce wrong result
so first check row #14 result as it can't be a redirection
And for row #14 ?! …
'cause a request code can't return same result as yours
As on my side row #14 can not be a redirection whatever the tool used
so I can't reproduce same wrong result …
Last chance : check your result for row #14 !
(Direct link on post #15)
Like we do not have same result as yours as it is very difficult
to get a redirection result when no redirection exists ‼
Read post #13, so try and write back what is exactly your result !
Sub DemoReq()
Dim R&, S$, U$
With New WinHttpRequest
On Error Resume Next
For R = 2 To Me.UsedRange.Rows.Count
U = IIf(Cells(R, 1).Value Like "http*", "", "http://") & Cells(R, 1).Value & IIf(Right(Cells(R, 1).Value, 1) = "/", "", "/")
.Open "GET", U, False
Err.Clear
.Send
If Err.Number Then
Cells(R, 2).Resize(, 2).Value = [{"no",""}]
Else
S = Left$(.Option(WinHttpRequestOption_URL), InStr(9, .Option(WinHttpRequestOption_URL), "/"))
Cells(R, 2).Resize(, 2).Value = IIf(S = U, [{"ok",""}], Array("redir", S))
End If
Next
End With
End Sub
Hi, Marc L!Future not belongs to those awaking up early but to those who read !
As a demonstration starter, directions to follow :
• open initial attachment (so the one from post #1)
then on VBE side
• activate Microsoft WinHTTP Services reference
• paste this code in the worksheet module of initial attachment :Code:Sub DemoReq() Dim R&, S$, U$ With New WinHttpRequest On Error Resume Next For R = 2 To Me.UsedRange.Rows.Count U = IIf(Cells(R, 1).Value Like "http*", "", "http://") & Cells(R, 1).Value & IIf(Right(Cells(R, 1).Value, 1) = "/", "", "/") .Open "GET", U, False Err.Clear .Send If Err.Number Then Cells(R, 2).Resize(, 2).Value = [{"no",""}] Else S = Left$(.Option(WinHttpRequestOption_URL), InStr(9, .Option(WinHttpRequestOption_URL), "/")) Cells(R, 2).Resize(, 2).Value = IIf(S = U, [{"ok",""}], Array("redir", S)) End If Next End With End Sub
Do you like it ? So thanks to click on bottom right Like !