One of my Excel VBA scripts cycles through all the versions of a particular ClearCase element to see if it was merged. This fails when a particular version was deleted using an rmver (using destructive deletes is not recommended but we do resort to this on rare occasions to get a developer out of a dependency).
In DOS, the following works perfectly:
IF EXIST M:\View\LAMI\build.xml@@\main\lc_adhoc_dev\3 ECHO Yes
Yes
To do this in VBA, I tried using the Dir method to check for the presence of a particular version:
Dim elementVersion As String
elementVersion = "M:\View\LAMI\build.xml@@\main\lc_adhoc_dev\3"
If Len(Dir(elementVersion)) > 0 Then
' Version exists
Else
' Version does not exist
End If
However, that results in an error "Bad file name or number":
I also tried the FileExists method of the fso object:
Dim elementVersion As String
elementVersion = "M:\View\LAMI\build.xml@@\main\lc_adhoc_dev\3"
Dim fsoObj As Object
Set fsoObj = CreateObject("Scripting.FileSystemObject")
If fsoObj.FileExists(elementVersion) = True Then
' Version exists
Else
' Version does not exist
End If
However, that call always returns False. It appears all these methods have issues with the ClearCase MVFS virtual M: drive. Is there anything else I could try?