Minimize IE window

A

AP

While in Excel, I use the code below to log in a website.

I would like the Internet Explorer (IE) window to be minimized (but not
invisible) the moment it pops up.

What can I add to the code for the IE window to be minimized?

-----------
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
With ie
.Visible = True
.navigate "https://www.xxx.com"
Do While .ReadyState <> 4: Loop
With .Document.all
.lid.Value = "username"
.pwd.Value = "password"
.submit.Click
Do While ie.ReadyState <> 4: Loop
End With
End With
Set ie = Nothing
 
G

Gary''s Student

Here is some similar code. We activate the system menu with ALT+SPACE and
move down and minimize from there:

Sub Launch_IE()

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
ActiveSheet.Activate
AppActivate ie
SendKeys ("% ")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{ENTER}")
DoEvents
End Sub

You can ignore the "window dressing" at the top of the macro.
 

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