I'm trying to use VBA script to run and use IE when Workbook is opened. I wrote following code, but IE window stays behind Excel window (only flashing in taskbar).
I'm using Office 2010 (32 bit) on Windows 7 (64 bit).
"Workbook_open" part of the code
"Module1" part of the code
I'm using Office 2010 (32 bit) on Windows 7 (64 bit).
"Workbook_open" part of the code
Code:
Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:02"), "Auto_run"
End Sub
"Module1" part of the code
Code:
Sub Auto_run()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
' Set IE parameters
IE.Top = 80
IE.Left = 600
IE.Width = 1300
IE.Height = 900
IE.AddressBar = 0
IE.StatusBar = 0
IE.Toolbar = 0
' Load URL
IE.Navigate ("http://www.google.com")
' Waiting for a page to load
While IE.Busy
DoEvents
Wend
' Make IE visible
IE.Visible = True
End Sub