What pain? Works fine for me:
You seem to be making this all far harder than it is.Code:Option Explicit Private Shell As Shell32.Shell Private Function GetFileVersion(ByVal FullName As String) As Variant Dim ShellFolderItem As Shell32.ShellFolderItem Set ShellFolderItem = Shell.NameSpace(ssfDESKTOP).ParseName(FullName) GetFileVersion = ShellFolderItem.ExtendedProperty("System.FileVersion") End Function Private Sub PrintVersion(ByVal FileVersion As Variant) If IsEmpty(FileVersion) Then Print "No version information" Else Print FileVersion End If End Sub Private Sub Form_Load() Set Shell = New Shell32.Shell PrintVersion GetFileVersion(App.Path & "\Project1.vbp") PrintVersion GetFileVersion(App.Path & "\Project1.exe") End Sub




Reply With Quote
