+ Reply to Thread
Results 1 to 5 of 5

Linking to IE

  1. #1
    Pablo
    Guest

    Linking to IE

    I put this out there earlier but may not have fully explained myself. I have
    a worksheet with a list of potential URLs in column A (A1...). I would like
    to take the URL and put it into an IE window, address field, and return the
    page name to the worksheet's column B (B1...). I want the macro to work
    through the list by itself.

    Lonnie and CodeSponge have gotten going but I am going to have troubles.

    Thanks,


  2. #2
    Sharad Naik
    Guest

    Re: Linking to IE

    Try below code:

    Sub GetPageName()
    Dim IE As InternetExplorer, c
    For Each c In Sheet1.Columns(1).SpecialCells(xlCellTypeConstants)
    Set IE = New InternetExplorer
    'if the url in entered in cells as text then keep
    'follwoing code line, and deletete next code line
    IE.Navigate c.Value
    'Or if the url is entered as a hyperlink then delete
    'above code line and keep following code line
    IE.Navigate c.Hyperlinks(1).Address
    Do Until IE.ReadyState = READYSTATE_COMPLETE
    DoEvents
    Loop
    c.Offset(0, 1).Value = IE.LocationName
    IE.Quit
    Set IE = Nothing
    Next c
    End Sub

    Sharad Naik

    "Pablo" <[email protected]> wrote in message
    news:[email protected]...
    >I put this out there earlier but may not have fully explained myself. I
    >have
    > a worksheet with a list of potential URLs in column A (A1...). I would
    > like
    > to take the URL and put it into an IE window, address field, and return
    > the
    > page name to the worksheet's column B (B1...). I want the macro to work
    > through the list by itself.
    >
    > Lonnie and CodeSponge have gotten going but I am going to have troubles.
    >
    > Thanks,
    >




  3. #3
    Sharad Naik
    Guest

    Re: Linking to IE

    For got mention that first you need to add reference to
    "Microsoft Internet Controls" libraray.

    Sharad

    "Sharad Naik" <[email protected]> wrote in message
    news:%[email protected]...
    > Try below code:
    >
    > Sub GetPageName()
    > Dim IE As InternetExplorer, c
    > For Each c In Sheet1.Columns(1).SpecialCells(xlCellTypeConstants)
    > Set IE = New InternetExplorer
    > 'if the url in entered in cells as text then keep
    > 'follwoing code line, and deletete next code line
    > IE.Navigate c.Value
    > 'Or if the url is entered as a hyperlink then delete
    > 'above code line and keep following code line
    > IE.Navigate c.Hyperlinks(1).Address
    > Do Until IE.ReadyState = READYSTATE_COMPLETE
    > DoEvents
    > Loop
    > c.Offset(0, 1).Value = IE.LocationName
    > IE.Quit
    > Set IE = Nothing
    > Next c
    > End Sub
    >
    > Sharad Naik
    >
    > "Pablo" <[email protected]> wrote in message
    > news:[email protected]...
    >>I put this out there earlier but may not have fully explained myself. I
    >>have
    >> a worksheet with a list of potential URLs in column A (A1...). I would
    >> like
    >> to take the URL and put it into an IE window, address field, and return
    >> the
    >> page name to the worksheet's column B (B1...). I want the macro to work
    >> through the list by itself.
    >>
    >> Lonnie and CodeSponge have gotten going but I am going to have troubles.
    >>
    >> Thanks,
    >>

    >
    >




  4. #4
    Pablo
    Guest

    Re: Linking to IE

    Sharad,

    Thanks for the code. This seems to be exactly what I need.

    "Sharad Naik" wrote:

    > For got mention that first you need to add reference to
    > "Microsoft Internet Controls" libraray.
    >
    > Sharad
    >
    > "Sharad Naik" <[email protected]> wrote in message
    > news:%[email protected]...
    > > Try below code:
    > >
    > > Sub GetPageName()
    > > Dim IE As InternetExplorer, c
    > > For Each c In Sheet1.Columns(1).SpecialCells(xlCellTypeConstants)
    > > Set IE = New InternetExplorer
    > > 'if the url in entered in cells as text then keep
    > > 'follwoing code line, and deletete next code line
    > > IE.Navigate c.Value
    > > 'Or if the url is entered as a hyperlink then delete
    > > 'above code line and keep following code line
    > > IE.Navigate c.Hyperlinks(1).Address
    > > Do Until IE.ReadyState = READYSTATE_COMPLETE
    > > DoEvents
    > > Loop
    > > c.Offset(0, 1).Value = IE.LocationName
    > > IE.Quit
    > > Set IE = Nothing
    > > Next c
    > > End Sub
    > >
    > > Sharad Naik
    > >
    > > "Pablo" <[email protected]> wrote in message
    > > news:[email protected]...
    > >>I put this out there earlier but may not have fully explained myself. I
    > >>have
    > >> a worksheet with a list of potential URLs in column A (A1...). I would
    > >> like
    > >> to take the URL and put it into an IE window, address field, and return
    > >> the
    > >> page name to the worksheet's column B (B1...). I want the macro to work
    > >> through the list by itself.
    > >>
    > >> Lonnie and CodeSponge have gotten going but I am going to have troubles.
    > >>
    > >> Thanks,
    > >>

    > >
    > >

    >
    >
    >


  5. #5
    CodeSponge
    Guest

    Re: Linking to IE

    Oops,
    I feel bad because you asked to clarify and I was away from my desk for
    a few days.
    Sorry about that.

    Sharad Naik is right you have to reference
    C:\WINDOWS\System32\shdocvw.dll
    before you can play with the IE interface cleanly


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1