ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pass IE web address to Excel (https://www.excelbanter.com/excel-programming/409013-pass-ie-web-address-excel.html)

grove

Pass IE web address to Excel
 
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

roger

Pass IE web address to Excel
 
"grove" wrote in message
...
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


--
roger



grove

Pass IE web address to Excel
 
Thanks, just the start I needed.

grove


All times are GMT +1. The time now is 08:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com