View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff[_2_] Harald Staff[_2_] is offline
external usenet poster
 
Posts: 449
Default run Internet explorer in VBA 2007 (EXCEL)

Good. Set your VB editor to "Require variable declaration" so that it enters
Option Explicit into your modules.
Add the control to a userform and the top dropdowns + intellisense will
reveal all properties and methods you need to get started. Here are the
important five. Add Textbox1 (for URL entry). Commandbutton1 ("Go") and
Commandbutton2 ("Back"):

Option Explicit

Private Sub CommandButton1_Click()
WebBrowser1.Navigate2 (Me.TextBox1.Text)
End Sub

Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, _
URL As Variant, Flags As Variant, _
TargetFrameName As Variant, PostData As Variant, _
Headers As Variant, Cancel As Boolean)
Me.Caption = "Loading " & URL
End Sub

Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As
Variant)
Me.Caption = "Done"
End Sub

Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
Me.Caption = Text
End Sub

Private Sub CommandButton2_Click()
WebBrowser1.GoBack
End Sub

The control is useful for more than webbrowsing, see Dick's articles on
http://www.dailydoseofexcel.com/?s=webbrowser+control

HTH. Best wishes Harald


"Dean" wrote in message
...
On Jan 6, 11:40 pm, "Harald Staff" wrote:
Yep, very possible, and the webbrowser control is the way to go. But it's
just a reading pane, you must provide and code all browserbuttons
and -menus
you would need.
If you're new to VBA, I suggest you don't start with this project, learn
the
basics first.

Best wishes Harald

"Dean" wrote in message

...



Hello, I am new to VBA and was just woundering if it is possible to
add a control on to a userform, where you can use the internet, I
looked at microsoft web browser control, but I am not sure how to do
it, could you help? Thanks- Hide quoted text -


- Show quoted text -


ok sure maybe I'm not that new, But i'm not the professional type