Pass IE web address to Excel

G

grove

I want to be able to send the current IE web address to Excel each
time the web address changes. Ideally with the ability to add a
comment in an adjacent cell.

Can I do this with IE running from within Excel? Any snippets of vba
code or ideas how to do this appreciated.

Thanks

grove
 
R

roger

grove said:
I want to be able to send the current IE web address to Excel each
time the web address changes. Ideally with the ability to add a
comment in an adjacent cell.

Can I do this with IE running from within Excel? Any snippets of vba
code or ideas how to do this appreciated.

Add a reference to "Microsoft Internet Controls"
(shdocvw.dll)

If you (for instance) have two text boxes on a form - for the web address
and comment.

In the form code...

'declare a variable like this
Dim WithEvents ie As SHDocVw.InternetExplorer

'open the browser like this
Set ie = New InternetExplorer
ie.Visible = True

'when this event fires, it will put the current url in textbox1
Private Sub ie_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
TextBox1.Value = ie.LocationURL
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top