get webpage title from URL

S8utt

Board Regular
Joined
Sep 27, 2005
Messages
126
Has anyone come across a macro / udf which can return the webpage title ?

I want to put a url in cell a1 for example http://uk.msn.com/?st=1

cell a2 I would like to try to return the webpage title, in this example

Hotmail, News, Sport, Music, Movies, Money, Cars, Shopping, Windows Live from MSN UK

I don;t really want the webpages being opened but if the macro udf had to open them, read the title and then close them that is ok.

Thanks for any help given.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi

Perhaps try

Code:
Sub GetPageTitle()
Dim a As String
    Set ie = CreateObject("InternetExplorer.Application")
    With ie
        .Visible = True
        .Navigate "http://uk.msn.com/?st=1"
        Do Until .ReadyState = 4
            DoEvents
        Loop
        Sheet1.Range("A1").Value = .document.Title
        .Quit
    End With
End Sub
 
Last edited:
Upvote 0
thanks for the swift responce.

i changed it a little to sut what I wanted.

Code:
Function GetPageTitle(a As String)

    Set ie = CreateObject("InternetExplorer.Application")
    With ie
        .Visible = False
        .Navigate a
        Do Until .ReadyState = 4
            DoEvents
        Loop
        GetPageTitle = .document.Title
        .Quit
    End With

    End Function

thanks again
 
Upvote 0
Hi ,

Can you help modify it so that i can get the data of table say for table 32 from all webpages in column A and dump the data in column B.

Thanx in Advance :):)
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top