Sometimes could be useful to select from folder the RAS project to open instead of write its path in Excel or inside the code.
The following are the commands to do this in VBA:
‘**********************************************
‘Choose files and folder
Dim fd As FileDialog
‘Select one or more files
Set fd = Application.FileDialog(msoFileDialogFilePicker)
‘Clear the filters and define as “*.prj”
fd.Filters.Clear
fd.Filters.Add “RAS project”, “*.prj”
Dim varSelectedFile As Variant
Dim strFilePrj As String
‘If more than one file has been selected only the last will be used
With fd
If .Show = -1 Then
For Each varSelectedFile In .SelectedItems
strFilePrj = CStr(varSelectedFile)
Next varSelectedFile
Else
End If
End With
Set fd = Nothing
‘*****************************************************
in the variable strFilePrj there is the path and name of the *.prj file you have selected.
I hope this help
Paolo Polo