GetSettingsThis is a featured page

Function GetSettings(ByVal vsFilePath)
'Returns a collection of names and values from the file.
'The file is an Excel spreadsheet saved as a CSV file.
'The first column in the file is the setting name and the second is the value.
'A third column can be used for comments.
' Dim cSettings
' Set cSettings = GetCSVCollection("Settings.csv")
Dim asRows, cSettings, i, asEntries

asRows = Split(GetFileContents(vsFilePath), vbCrLf)
Set cSettings = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(asRows)
asEntries = Split(asRows(i), ",")
If UBound(asEntries) > 0 Then
cSettings.Add Trim(asEntries(0)& ""), Trim(asEntries(1) & "")
End If
Next

Set GetSettings = cSettings
End Function


No user avatar
2buck
Latest page update: made by 2buck , Dec 2 2006, 11:35 AM EST (about this update About This Update 2buck Edited by 2buck


view changes

- complete history)
Keyword tags: None (edit keyword tags)
More Info: links to this page

Anonymous  (Get credit for your thread)


There are no threads for this page.  Be the first to start a new thread.