Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

getting the version number

Posted on 1999-01-13
3
Medium Priority
?
144 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
[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
3 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1456059
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
ID: 1456060
I would like to use the API Call.
Please submit the code nessessary.
Thank You

0
 
LVL 1

Accepted Solution

by:
jeffcameron earned 90 total points
ID: 1456061
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 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