Oregon hai ragione, mi hanno distratto e mi sono dovuto alzare dalla postazione; quindi in un modulo Bas inserisci:
codice:
Option Explicit
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
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
'--------------------------------------------------------------
Public Function INIRead(File As String, Section As String, _
Item As String) As String
Dim sBuf As String, iRC As Integer
sBuf = Space(255)
iRC = GetPrivateProfileString(Section, Item, "Not Found", sBuf, 255, App.Path + "/" + File)
sBuf = Left$(sBuf, iRC)
If StrComp(sBuf, "Not Found") = 0 Then
INIRead = vbNullString
Else
INIRead = sBuf
End If
End Function
'--------------------------------------------------------------
Public Sub INIWrite(File As String, Section As String, _
Item As String, ItemValue As String)
WritePrivateProfileString Section, Item, ItemValue, App.Path + "/" + File
End Sub
Il codice l'ho provato e funziona.
Ciao e buon lavoro !