Solved

Get Internet Explorer version from VBA

Posted on 2013-01-10
2
2,567 Views
Last Modified: 2013-01-10
Hi,

I am looking for some VBA code that tells me what IE version is installed. In IE8, I could do like this:

Set InternetExplorer = CreateObject("InternetExplorer.Application")
InternetExplorer.Visible = True
InternetExplorer.Navigate "https://www.google.se/"

InternetExplorer.Document.parentWindow.execScript "document.clear(); document.write(navigator.appVersion);"
str_IEVersion = Trim(Split(InternetExplorer.Document.DocumentElement.outerText, ";")(1))

Open in new window


And the result would be "MSIE 8.0". In IE9 however, this code results in this error message: "Run-time error -2147352319 (80020101)". Anyone?
0
Comment
Question by:Sandstedt
2 Comments
 
LVL 26

Accepted Solution

by:
MacroShadow earned 500 total points
Comment Utility
0
 

Author Comment

by:Sandstedt
Comment Utility
Thank you! Solution:

Dim obj_FSO As Object
Dim obj_Shell As Object
Dim str_IEVersion As String

Set obj_FSO = CreateObject("scripting.filesystemobject")
Set obj_Shell = CreateObject("wscript.shell")

str_IEVersion = obj_FSO.getfileversion(obj_Shell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\" & "App Paths\IEXPLORE.EXE\"))

Open in new window


Result: "9.0.8112.16457"
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
A short article about problems I had with the new location API and permissions in Marshmallow
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now