Launch IE Browser and manage vertical scroll bars

G

Guest

Using VBA, I need to start an Internet Explorer browser from Excel. The
below code does this but I am not able to control the vertical scroll bars
from my VBA application. How do I do this so I can poisition the scroll bar
where I want it displayed?

Here is the vb code that works:

Set Ie = CreateObject("InternetExplorer.Application")
Ie.AddressBar = False
Ie.MenuBar = False
Ie.Toolbar = False
Ie.Width = 600
Ie.Height = 750
Ie.Left = 0
Ie.Top = 0

Ie.navigate "www.yahoo.com"
Ie.resizable = True
Ie.Visible = True

Ie.document.vscrollbar.value = 200 ' THIS DOES NOT WORK !!

Thanks,

Gary
 
G

Guest

Hi,

Try this

Sub LaunchIeAndManageVerticalScroll()
Const READYSTATE_COMPLETE& = 4&
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
.AddressBar = False
.MenuBar = False
.Toolbar = False
.Width = 600&
.Height = 750&
.Left = 0&
.Top = 0&
.navigate "www.yahoo.com"
.resizable = True
While Not .readyState = READYSTATE_COMPLETE
DoEvents
Wend
.document.parentWindow.scroll 0&, 200&
.Visible = True
End With
Set ie = Nothing
End Sub

Alain CROS
 
G

Guest

Arlan,

This works perfectly !!

Thanks fro your help. I was stuck on this for a long time.

Gary
 

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