Solved

getting the version number

Posted on 1999-01-13
3
137 Views
Last Modified: 2010-05-03
I would like to retrieve the version number of a program without running it, so I can compare it to a newer version number and update as needed.
Any ideas...?
0
Comment
Question by:dtucker
3 Comments
 
LVL 12

Expert Comment

by:mark2150
Comment Utility
Easier to watch the date/time stamp. Different time/date = different version. Later = newer.

Otherwise you'ld have to diddle with an API call to look at properties (assuming that they used the App.Major/.Minor properties).

M

0
 

Author Comment

by:dtucker
Comment Utility
I would like to use the API Call.
Please submit the code nessessary.
Thank You

0
 
LVL 1

Accepted Solution

by:
jeffcameron earned 30 total points
Comment Utility
I couldn't get it to work because it was taking too much time for too few points, but here is where i left off.  i am pretty sure 95% of it is correct, just i think i need a type declaration for the data i am passing called pBlock.


Public Declare Function GetFileVersionInfo Lib "version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwHandle As Long, ByVal dwLen As Long, lpData As Any) As Long
Public Declare Function GetFileVersionInfoSize Lib "version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Public Declare Function VerQueryValue Lib "version.dll" (pBlock As Any, ByVal lpSubBlock As String, ByVal lplpBuffer As Long, puLen As Long) As Long


Sub GetFileVersion()
Dim fname As String
Dim lenFV As Long
Dim Version As Long
Dim VersionLen As Long
Dim pBlock As String

fname = "C:\Program Files\Microsoft Office\Office\EXCEL.EXE"

lenFV = GetFileVersionInfoSize(fname, 0)

GetFileVersionInfo fname, 0, lenFV, pBlock

VerQueryValue pBlock, "\\StringFileInfo\\040904E4\\FileVersion", _
              Version, _
              VersionLen

MsgBox Version

End Sub
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

7 Experts available now in Live!

Get 1:1 Help Now