ok u saw the UserForm now here is the entire module:
Public Type FileType
FileName As String
FileType As String
FileLib As String
FileVer As String
FileDest As String
CFlags As String
End Type
Public Type ARLType
ARLGen As Long
ARLCus As Long
ARLSpe As Long
ARLName As String
ARLLib As String
ARLVer As String
ARLTVer As String
ArlSubSys As String
ArlFile() As FileType
End Type
Public ARL() As ARLType
Public Function GoToSection(ByRef File As TextStream, ParamArray SecName() As Variant) As Boolean
Dim i As Integer
Dim data As String
GoToSection = False
Do While Not File.AtEndOfStream
data = File.ReadLine
For i = 0 To UBound(SecName)
If InStr(1, data, "[" & UCase(SecName(i)) & "]", vbTextCompare) = 1 Then
GoToSection = True
Exit Do
End If
Next i
Loop
End Function
Public Sub ReadARLFile(ByRef File As TextStream, ByVal arlIndex As Long, ByRef ARL() As ARLType)
Dim index As Long, pos As Long
Dim data As String
Dim AFileName As String, AFileLib As String, AFileVer As String, AFileDest As String, AFileCFlag As String
Dim flag As Boolean
index = 0
data = File.ReadLine
flag = False
Do While Not File.AtEndOfStream And Not (Left(data, 1) = "[" And flag = True)
'replace tab by space
pos = InStr(1, data, Chr(9), vbTextCompare)
Do While pos > 0
data = Left(data, pos - 1) & " " & Right(data, Len(data) - pos)
pos = InStr(1, data, Chr(9), vbTextCompare)
Loop
data = Trim(data)
Debug.Print data
If Left(data, 1) = "[" Then
flag = True
End If
If Left(data, 3) <> "/*~" And Left(data, 1) <> "#" And data <> "" Then
pos = InStr(1, data, "=", vbTextCompare)
If pos > 0 Then
AFileName = Trim(Left(data, pos - 1))
data = Trim(Right(data, Len(data) - pos))
If data <> "" Then
SubStr = Split(data, "|"

If UBound(SubStr) > 2 Then
AFileLib = Trim(SubStr(0))
AFileVer = Trim(SubStr(1))
AFileDest = Trim(SubStr(2))
AFileCFlag = Trim(SubStr(3))
If AFileLib <> "-" Then
ReDim Preserve ARL(arlIndex).ArlFile(index)
With ARL(arlIndex).ArlFile(index)
.FileName = AFileName
.FileLib = AFileLib
.FileVer = AFileVer
.FileDest = AFileDest
If AFileCFlag <> "-" And AFileCFlag <> "." Then
.CFlags = AFileCFlag
Else
.CFlags = ""
End If
End With
End If
index = index + 1
End If
End If
End If
End If
data = File.ReadLine
Loop
End Sub
Public Sub ReadARLSection(ByRef File As TextStream, ByRef Subsys As String, ByRef TheDest() As ARLType)
Dim pos As Long, index As Long
Dim data As String
If TheDest(0).ARLName <> "" Then
index = UBound(TheDest) + 1
Else
index = 0
End If
data = File.ReadLine
Do While Not File.AtEndOfStream And Left(data, 1) <> "["
data = Trim(data)
If Left(data, 3) <> "/*~" And Left(data, 1) <> "#" And Left(data, 2) <> "/*" And Left(data, 2) <> "//" Then
pos = InStr(1, data, "=", vbTextCompare)
If pos > 0 Then
ReDim Preserve TheDest(index)
TheDest(index).ArlSubSys = TheDest(index).ArlSubSys & "-" & Subs
TheDest(index).ARLName = Trim(Left(data, pos - 1))
data = Trim(Right(data, Len(data) - pos))
pos = InStr(1, data, "|", vbTextCompare)
TheDest(index).ARLLib = Trim(Left(data, pos - 1))
data = Trim(Right(data, Len(data) - pos))
pos = InStr(1, data, "#", vbTextCompare)
If pos > 0 Then
TheDest(index).ARLVer = Trim(Left(data, pos - 1))
Else
TheDest(index).ARLVer = Trim(data)
End If
If Left(TheDest(index).ARLVer, 1) = "v" Or Left(TheDest(index).ARLVer, 1) = "r" Then
TheDest(index).ARLVer = Right(TheDest(index).ARLVer, Len(TheDest(index).ARLVer) - 1)
End If
index = index + 1
End If
End If
data = File.ReadLine
Loop
End Sub
Public Sub ReadConf(ByVal File As TextStream, ByRef SubTab() As String, ByVal Path As String)
'find all subsystems from mc1_conf.def
Dim data As String
Dim i As Integer
Dim SubsysPath As String
i = -1
Do While Not File.AtEndOfStream
data = File.ReadLine
If LCase(Left(data, 7)) = "subsys_" Then
i = i + 1
ReDim Preserve SubTab(i)
SubsysPath = Left(Path, InStr(1, Path, "\mc1_u\work\conf"

) & "mc1_" & Mid(data, 8, 1) & "\work\config"
SubTab(i) = SubsysPath & "\" & Left(data, 8) & ".def"
End If
Loop
End Sub
Public Function OpenProject()
Dim objFSO As New FileSystemObject
Dim objText As TextStream, objTextFile As TextStream
Dim Path As String, PathFile As String
Dim Subsys() As String, mySubsys As String, ConfFile As String
Dim ARL() As ARLType
Dim bFound As Boolean
'path has to be defined
Path = "h:\p_rm1\502\mc1_u\work\config"
'take respective subsystem
ConfFile = Path & "\mc1_conf.def"
'ReDim Subsys(0)
'Subsys(0) = Path & "subsys_" & Mid(Path, InStr(1, Path, "\work\", vbTextCompare) - 1, 1) & ".def"
mySubsys = Path & "\" & "subsys_u.def"
If objFSO.FileExists(ConfFile) Then
Set objText = objFSO.OpenTextFile(ConfFile, ForReading)
If GoToSection(objText, "PRJ_SUBSYS"

= True Then
Call ReadConf(objText, Subsys(), Path)
ReDim ARL(0)
For i = 0 To UBound(Subsys)
If LCase(Subsys(i)) = LCase(mySubsys) And objFSO.FileExists(Subsys(i)) Then
Set objTextFile = objFSO.OpenTextFile(Subsys(i), ForReading)
If GoToSection(objTextFile, "PRJ_AGR", "PRJ_AGGR"

Then
bFound = True
ReDim TheDest(0)
Call ReadARLSection(objTextFile, Subsys(i), ARL())
End If
objTextFile.Close
End If
Next i
Else
MsgBox "Cannot find 'PRJ_SUBSYS' section in configuration file.", vbOKOnly + vbExclamation, "Missing data !"
End If
objText.Close
End If
If bFound Then
For i = 0 To UBound(ARL)
PathFile = Path & "\" & ARL(i).ARLName & ".arl"
If objFSO.FileExists(PathFile) Then
Set objTextFile = objFSO.OpenTextFile(PathFile, ForReading)
ReadARLFile objTextFile, i, ARL
End If
Next i
End If
End Function