Capturing Redirected URL with Macro RRS feed

  • Question

  • Dear All,

    I am trying to capture the redirected URL, with the following piece of code, but the code fails

    @ "redirurl = myIE.Document.URL" with "Run Time Error '-2147467259 (80004005) Method 'Document' of Object 'IWebBrowser2' Failed" error. Could anyone pls help me, how to fix the issue.

    Dim myIE As Object
    Dim redirurl As String
    Set myIE = CreateObject("InternetExplorer.Application")
    myIE.Visible = True

    myIE.Navigate <Actual URL>

    Do While myIE.Busy

    'This below piece of code throwing me the runtime error
    redirurl = myIE.Document.URL</url1>

    FYI, I am using Windows 7 + MS Office 2007 + IE9
    • Moved by Youjun Tang Friday, July 17, 2015 6:22 AM more appropriate
    Wednesday, July 15, 2015 6:21 PM

All replies

  • Hello,

    This appears not to be VB.NET so can you specify which development environment you are working in.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.

    Wednesday, July 15, 2015 9:23 PM
  • Maybe you should try one of the Microsoft Office for Developer Forums.

    La vida loca

    Wednesday, July 15, 2015 9:43 PM