I'm using the code below in WORD2010 and it works like it should to check the actual version;
Transfering this code to EXCEL2010....
...it produces an error in line:
What is wrong with the EXCEL code ?
Code:
Function version_check() As Boolean 'WORD function
'define version number
Dim thisversion As Integer
thisversion = 4
'read version from external file called version.txt
Dim Vfso As FileSystemObject
Dim Vfile As File
Set Vfso = CreateObject("Scripting.FileSystemObject")
Set Vfile = Vfso.GetFile("\\cos\share\starlms1\Admin\SEMtools\version.txt")
If thisversion = System.PrivateProfileString(Vfile, "Actual_Version", "WordTools") Then
version_check = True
Else
version_check = False
End If
Set Vfso = Nothing
End Function
Transfering this code to EXCEL2010....
Code:
Function version_check() As Boolean 'EXCEL function
'define version number
Dim thisversion As Integer
thisversion = 1
'read version from external file called version.txt
Dim Vfso As FileSystemObject
Dim Vfile As File
Set Vfso = CreateObject("Scripting.FileSystemObject")
Set Vfile = Vfso.GetFile("T:\Admin\LIMStools\version.txt")
'check LIMStools version
If thisversion = System.PrivateProfileString(Vfile, "Actual_Version", "ExcelTools") Then
version_check = True
Else
version_check = False
End If
Set Vfso = Nothing
End Function
...it produces an error in line:
Code:
If thisversion = System.PrivateProfileString(Vfile, "Actual_Version", "ExcelTools") Then
What is wrong with the EXCEL code ?