Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading a Different Page Robert Maddox Excel Discussion (Misc queries) 0 October 20th 06 07:16 PM
control gif file name when I save as web page? GoBobbyGo Excel Discussion (Misc queries) 0 August 2nd 06 02:33 PM
Launch new browser window from an excel web page Hal Anderson Excel Discussion (Misc queries) 2 January 20th 06 02:10 AM
page control & sub-totals Brian Excel Programming 1 October 8th 03 02:51 AM
Web page loading Matt Cohen Excel Programming 4 October 3rd 03 07:31 PM


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"