PDA

View Full Version : Solved: Check Internet Explorer Version from Excel



bconner
10-15-2010, 10:26 AM
I have a macro that is grabbing data from Excel and Inputing into a Web-Based application. I want to check the version of Internet Explorer the user has and if it's version 8 or higher continue with running macro if it earlier than version 8 popup a message box requesting they install version 8 or 9.... Can someone show me what the code would be for this? Any help is greatly appreciated.

Kenneth Hobs
10-15-2010, 10:42 AM
Sub IEVersion()
Dim ie As Object

Set ie = CreateObject("internetexplorer.application")

ie.Visible = False

ie.Navigate "about:blank"

'wait for page to load
Do While ie.Busy And Not ie.readyState = 4:
Application.Wait (Now + TimeValue("0:00:02"))
DoEvents
Loop

ie.document.parentWindow.execScript "document.clear(); document.write(navigator.appVersion);"
MsgBox Split(ie.document.DocumentElement.outerText, ";")(1)

ie.Quit
Set ie = Nothing
End Sub

bconner
10-15-2010, 10:51 AM
Thanks Mr. Hobs that was what I needed...