Solved

Get Internet Explorer version from VBA

Posted on 2013-01-10
2
2,795 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 38764894
0
 

Author Comment

by:Sandstedt
ID: 38764945
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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Progress

726 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