se metto così non funziona:
codice:
Debug.Print tempStr = Replace(words(i), ",", "")
Per quanto riguarda la classe clsIniF, l'ho trovata in internet con un esempio... Eccola:
codice:
Option Explicit
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
Private Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private fIni As String
' SCRIVE UNA SEZIONE/CHIAVE/VALORE SU UN FILE INI
Public Function ScriviIni(ByVal sezione As String, ByVal chiave As String, ByVal valore As String, ByVal nfile As String) As Boolean
Dim r As Long
fIni = App.Path & "\" & nfile
r = WritePrivateProfileString(sezione, chiave, valore, fIni)
If r = 0 Then
ScriviIni = False
Else
ScriviIni = True
End If
End Function
' rESTITUISCE IL VALORE DI UNA DETERMINATA CHIAVE IN UNA DETERMINATA SEZIONE DEL FILE INI
Public Function LeggiIni(ByVal sezione, chiave As String, ByVal nfile As String) As String
Dim r As Long
Dim x As Integer
Dim temp As String * 50
Dim temp1 As String
Dim n As String
fIni = App.Path & "\" & nfile
r = GetPrivateProfileString(sezione, chiave, n, temp, Len(temp), fIni)
If r <> 0 And Len(temp) > 0 Then
For x = 1 To 50
n = Mid(temp, x, 1)
If n <> Chr(0) Then
temp1 = temp1 & n
End If
Next x
LeggiIni = temp1
Else
LeggiIni = ""
End If
End Function
' Questa funzione mi restituisce una stringa con ile chiavi e i valori contenuti in una determinata
' sezione del file ini.
' OGNI VALORE è SPEZZATO DAL CARATTERE CHR(0) - PARSER PER RECUPERARE I SINGOLI VALORI
Public Function RecSez(ByVal sezione As String, ByVal nfile As String) As String
Dim buffer As String * 10000
Dim x As Integer
Dim newString As String
Dim n As String
fIni = App.Path & "\" & nfile
GetPrivateProfileSection sezione, buffer, 30000, fIni
For x = Len(buffer) To 1 Step -1
n = Mid(buffer, x, 1)
If n <> Chr(0) Then
newString = Left(buffer, x)
Exit For
End If
Next x
RecSez = newString
End Function