DLL (API ne pas enregistrer) 3 Ko fait le boulot en instantané.
Tests faits dans module vba Excel.
Fichiers en accès exclusif, doivent être fermés avant appel fonction.
bnVrgl.txt contient code de la DLL.
' ------------------------ WORKBOOK OPEN
Declare Sub SetCurrentDirectoryA Lib "Kernel32.dll" (ByVal pdir As String)
' ------------------------
Declare Function bnPointsEnVirgules Lib "bnVrgl.dll" (ByVal szFile As String) As Long
Declare Function bnVirgulesEnPoints Lib "bnVrgl.dll" (ByVal szFile As String) As Long
Sub TestPointsEnVirgules()
Dim r As Long
r = bnPointsEnVirgules("TestVb.txt")
If r Then
MsgBox "ERREUR", vbExclamation
Else: MsgBox "OK", vbInformation
End If
End Sub
Sub TestVirgulesEnPoints()
Dim r As Long
r = bnVirgulesEnPoints("TestVb.txt")
If r Then
MsgBox "ERREUR", vbExclamation
Else: MsgBox "OK", vbInformation
End If
End Sub