launch internet explorer from excel


P

Pradip Jain

i use the following code to launch Internet Explorer from excel. It works.
Problem is after the page is open i want to refresh the window automatically.
how to do that??


Sub LaunchIE_FSA_11()

Set ie = CreateObject("InternetExplorer.Application")
ie.AddressBar = False
ie.MenuBar = False
ie.Toolbar = False
ie.Width = 610
ie.Height = 700
ie.Left = 0
ie.Top = 0
ie.navigate
"http://www.nseindia.com/marketinfo/equities/cmquote_tab.jsp?key=GAILEQN&symbol=GAIL&flag=0"
ie.resizable = True
ie.Visible = True
End Sub

ie.Refresh = True, does not work. please help. TIA
 
Ad

Advertisements

G

Gary''s Student

There is probably some kind of refresh Method in the IE Object Model, but
here is a way to have VBA do what the user does: touch F5 in IE for a
refresh:

Sub LaunchIE_FSA_11()

Set ie = CreateObject("InternetExplorer.Application")
ie.AddressBar = False
ie.MenuBar = False
ie.Toolbar = False
ie.Width = 610
ie.Height = 700
ie.Left = 0
ie.Top = 0
ie.navigate "http://www.cnn.com"

ie.resizable = True
ie.Visible = True

MsgBox ("ready to refresh??")
AppActivate ie
SendKeys "{F5}"
DoEvents
End Sub
 
P

Pradip Jain

although it works, not a very neat solution.

anybody else has a better alternative - please help
 
Ad

Advertisements

G

Gary''s Student

I agree, it is not very neat.

How about just repeating the Navigate statement whenever you want to refresh??
 

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