Hi guys,

I am trying to write a macro that automates the testing of an implementation of a redirection.

I am using Internet Explorer to automatically run through these URLs(urlFrom) and compare the end-state URL with what is the intentional redirection (urlTo).

For example, www.a.com needs to redirect to www.b.com. If it actually does, then the function returns true.

Here is my current code:

Please Login or Register  to view this content.
This code works perfectly fine with HTML pages. e.g. http://www.twitter.com --> https://twitter.com/

However, when i try to access a URL with a .pdf, I am unable to identify the redirection. (urlTemp gives me null)

I'm not sure why this is so because when I manually access the URL using IE, it redirects properly and the URL in the address bar changes.

However, when accessed through excel, IE prompts for download of the pdf, somehow skipping the navigation step.

Could any experts help?