Function FileToDictionary(strFile) 'Reads an ini-style file and returns a dictionary Dim fs 'As Scripting.FileSystemObject Dim ts 'As Scripting.TextStream Dim strLine, dic, colNames, strName Const ForReading = 1 Set dic = CreateObject("Scripting.Dictionary") Set fs = CreateObject("Scripting.FileSystemObject") If fs.FileExists(strFile) Then Set ts = fs.OpenTextFile(strFile, ForReading, True) Do Until ts.AtEndOfStream strLine = ts.ReadLine If ((InStr(strLine, "=") > 1) And (InStr(strLine, "=") < (Len(strLine)))) Then If dic.Exists(Split(strLine, "=")(0)) Then dic(Split(strLine, "=")(0)) = Split(strLine, "=")(1) Else dic.Add Split(strLine, "=")(0), Split(strLine, "=")(1) End If End If Loop ts.Close End If Set FileToDictionary = dic End Function