View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Can I find what ver of IE is running via VBA ?

http://groups.google.com/groups?thre...00%40hydro.com

Has a couple of scripts that you can embed into your code:

Here's with the vba mods:

Option Explicit
Sub testme01()

Dim FSO As Object
Dim Shell As Object
Dim sKey As String
Dim sPath As String

Set FSO = CreateObject("scripting.filesystemobject")
Set Shell = CreateObject("wscript.shell")
sKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersio n\" _
& "App Paths\IEXPLORE.EXE\"
sPath = Shell.RegRead(sKey)
MsgBox FSO.getfileversion(sPath)

End Sub

'the second one uses Split. It needs xl2k or higher.


Sub testme02()
Dim oShell As Object
Dim SRegPath As String
Dim sIEVer As String
Dim iMajorVersion As Long
Dim iMinorVersion As Long
Dim iBuildVersion As Long
Dim iSubBuildVersion As Long
Dim aIEVer As Variant


SRegPath = "HKLM\SOFTWARE\Microsoft\Internet Explorer\Version"

Set oShell = CreateObject("wscript.shell")
On Error Resume Next
sIEVer = oShell.RegRead(SRegPath)

If Err < 0 Then
' IE version is 3.0 or less, set it to 0
sIEVer = "0.0.0.0"
End If
On Error GoTo 0

aIEVer = Split(sIEVer, ".")
iMajorVersion = CLng(aIEVer(0))
iMinorVersion = CLng(aIEVer(1))
iBuildVersion = CLng(aIEVer(2))
iSubBuildVersion = CLng(aIEVer(3))

MsgBox "IE full version is : " & sIEVer
MsgBox "IE version is : " & iMajorVersion & "." & iMinorVersion
End Sub



Neil wrote:

Is there anyway to get the version number for an
installed programme via VBA in Excel ?

Many thanks in advance...


--

Dave Peterson