Declare the two Windows API function imports
Public Declare Function GetPrivateProfileStringA Lib "kernel32.dll" (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 Declare Function WritePrivateProfileStringA Lib "kernel32.dll" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
For reading
sReturn = Space(255)
sReturn = Left(sReturn, GetPrivateProfileStringA(header, key, defaultReturn, sReturn, 255, filePath))
For writting
WritePrivateProfileStringA header, key, Datum, filePath
Remember the structure of an INI file is
[header]
key=data