Hola. podrias hacer algo masomenos así:
'--------for INI file read/write
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
'-------------------
'reads ini string
Public Function ReadIni(FileName As String, Section As String, Key As String) As String
Dim RetVal As String * 255, v As Long
v = GetPrivateProfileString(Section, Key, "", RetVal, 255, FileName)
ReadIni = Left(RetVal, v)
End Function
'writes ini
Public Sub WriteIni(FileName As String, Section As String, Key As String, Value As String)
WritePrivateProfileString Section, Key, Value, FileName
End Sub
Private Sub Form_Load()
Dim valorleido As String
Dim NombreArchivo As String
NombreArchivo = App.Path & "\Config.ini"
If Dir(NombreArchivo) <> "" Then 'verificamos si existe el archivo pa' cuando abrimos por primera vez
valorleido = ReadIni(NombreArchivo, "Opcion", "Valor")
Select Case valorleido 'verificamos el valor leido y asignamos
Case "1"
Option1.Value = True
Case "2"
Option2.Value = True
Case "3"
Option3.Value = True
End Select
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim Str As String
Dim miOboton As Control
Dim valorescribir As String
Dim NombreArchivo As String
NombreArchivo = App.Path & "\Config.ini"
'Verificamos cual option buttons esta seleccionado
For Each miOboton In Me.Controls
If TypeOf miOboton Is OptionButton And miOboton.Value = True Then
Select Case miOboton.Name
Case "Option1"
valorescribir = "1"
Case "Option2"
valorescribir = "2"
Case "Option3"
valorescribir = "3"
End Select
End If
Next
WriteIni NombreArchivo, "Opcion", "Valor", valorescribir
End Sub
Quizás lo complique un poco :S. pero funciona bien.