Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loading a web page on a web browser control
Hi guys,
In a workbook, I have a form where I have put in a web browser control. I would like to be able to click on a command button to open the form and populate the web browser control with a path on my computer eg.C:\Samples folder. I dont know how to get even a web address to be seen in the web browser control. Any help greatly appreciated. Aaron -- --------------------------------------------------------------------- "Are you still wasting your time with spam?... There is a solution!" Protected by GIANT Company's Spam Inspector The most powerful anti-spam software available. http://mail.spaminspector.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loading a web page on a web browser control
Pls try like this.
*Put a Label control as a Label1 in the Userform1 Code: -------------------- 'Place the code below in Standard Module Sub TestShowForm() '// Change here to the path Const URL As String = "http://www.interq.or.jp/sun/puremis/colo/home.htm" With UserForm1 .WebBrowser1.Navigate URL Do Until .WebBrowser1.ReadyState = 4 DoEvents Loop .Show End With End Sub 'Place the code below in UserForm Module Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) Me.Label1.Caption = Me.WebBrowser1.LocationURL End Sub -------------------- --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loading a web page on a web browser control
Colo,
You are a champ! Thank you mate! What I wanted to do is to load a path on my drive eg.explorer, which your code works. Is it possible to add a search button? -- --------------------------------------------------------------------- "Are you still wasting your time with spam?... There is a solution!" Protected by GIANT Company's Spam Inspector The most powerful anti-spam software available. http://mail.spaminspector.com "Colo " wrote in message ... Pls try like this. *Put a Label control as a Label1 in the Userform1 Code: -------------------- 'Place the code below in Standard Module Sub TestShowForm() '// Change here to the path Const URL As String = "http://www.interq.or.jp/sun/puremis/colo/home.htm" With UserForm1 .WebBrowser1.Navigate URL Do Until .WebBrowser1.ReadyState = 4 DoEvents Loop .Show End With End Sub 'Place the code below in UserForm Module Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) Me.Label1.Caption = Me.WebBrowser1.LocationURL End Sub -------------------- --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loading a web page on a web browser control
Aaron, it can be done. :D
Put controls below in Userform1 Label1, Textbox1, CommandButton1,WebBrowser1 Pls have a look @ Attached file! Code: -------------------- 'Place the code below in Standard Module Sub TestShowForm() '// Change here to the path Const url As String = "http://www.excelforum.com/t178929-s" With UserForm1 .WebBrowser1.Navigate url Do Until .WebBrowser1.ReadyState = 4 DoEvents Loop .Show End With End Sub 'Place the code below in UserForm Module Private Sub CommandButton1_Click() Const urlGoogle As String = _ "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=" Dim strKeyWrd As String strKeyWrd = Replace(Me.TextBox1, " ", "+") Me.WebBrowser1.Navigate urlGoogle & strKeyWrd End Sub Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, url As Variant) Me.Label1.Caption = Me.WebBrowser1.LocationURL End Sub -------------------- Attachment filename: browsersample.xls Download attachment: http://www.excelforum.com/attachment.php?postid=398130 --- Message posted from http://www.ExcelForum.com/ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loading a web page on a web browser control
I think I did misread your qtn...
Is it possible to add a search button? Does it mean a file Search button? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Loading a Different Page | Excel Discussion (Misc queries) | |||
control gif file name when I save as web page? | Excel Discussion (Misc queries) | |||
Launch new browser window from an excel web page | Excel Discussion (Misc queries) | |||
page control & sub-totals | Excel Programming | |||
Web page loading | Excel Programming |