Can you use VBA to find a programs version?

PuddinPie
NewLounger
Posts: 5
Joined: 30 Apr 2013, 13:24

Can you use VBA to find a programs version?

Post by PuddinPie »

Hello.
I was wondering if it was possiable to use vba to find the version of a program. I know it can be done with windows and any office but can it be done to find the version of a non-microsoft application?


Thank you

User avatar
HansV
Administrator
Posts: 78530
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Can you use VBA to find a programs version?

Post by HansV »

You can use code like this:

Code: Select all

Sub GetVersion()
    Dim fso As Object
    Dim strVersion As String
    Set fso = CreateObject("Scripting.FileSystemObject")
    strVersion = fso.GetFileVersion("C:\Program Files (x86)\CCleaner\CCleaner64.exe")
    MsgBox strVersion
End Sub
Best wishes,
Hans

PuddinPie
NewLounger
Posts: 5
Joined: 30 Apr 2013, 13:24

Re: Can you use VBA to find a programs version?

Post by PuddinPie »

Thank you. It works like a charm.