Private Declare Function GetPrivateProfileString Lib "kernel32.dll" Alias "GetPrivateProfileStringA" _ (ByVal lpAppName As String, _ ByVal lpKeyName As String, _ ByVal lpDefault As String, _ ByVal lpReturnedString As String, _ ByVal nSize As Long, _ ByVal lpFileName As String) As Long Private Declare Function WritePrivateProfileString Lib "kernel32.dll" Alias "WritePrivateProfileStringA" _ (ByVal lpAppName As String, _ ByVal lpKeyName As String, _ ByVal lpString As String, _ ByVal lpFileName As String) As Long Private Function GetValueFromINI(ByVal strINIFileName, _ ByVal strName As String, ByVal strDefaultValue As String, _ Optional ByVal strSection As String = "MAIN") As String ' return string from the INI file "VBCOM" section Dim lpstr As String, Result As Integer lpstr = Space(10000) Result = GetPrivateProfileString(strSection, strName, strDefaultValue, lpstr, 5000, strINIFileName) Result = InStr(1, lpstr, Chr(0), vbBinaryCompare) If Result <> 0 Then lpstr = Left(lpstr, Result - 1) GetValueFromINI = lpstr End Function Private Sub WriteValueToINI(ByVal strINIFileName, _ ByVal strName As String, ByVal strString As String, _ Optional ByVal strSection As String = "MAIN") WritePrivateProfileString strSection, strName, strString, strINIFileName End SubHTH.