J'ai ouvert ton classeur tout à l'heure, et je pense qu'il faut une dll 64 bit.
Pour charger une dll et voir si son chargement est bon ou non, on peux utiliser une API Microsoft "kernel32" : fonction
LoadLibrary. Si cette fonction charge une dll, elle renvoie un handle, sinon, elle renvoie 0.
A mettre dans un module, tout en haut du module:
1 2 3 4 5
| #If VBA7 Then
Private Declare PtrSafe Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As LongPtr
#Else
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
#End If |
A mettre en dessous dans le même module:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Public Function TestChargementDLL() As Boolean
#If VBA7 Then
Dim Réponse As LongPtr
#Else
Dim Réponse As Long
#End If
Réponse = LoadLibrary(ThisWorkbook.Path & "\refprop.dll") 'Le nomcomplet est à adapter.
If Réponse <> 0 Then
TestChargementDLL = True
Else
MsgBox "Ne peux pas charger la dll" & "refprop.dll"
End If
End Function |
De l'extérieur, test par:
1 2 3 4
| Sub Appel_TestChargementDLL()
Dim Réponse As Boolean
Réponse = TestChargementDLL
End Sub |
Essaie de charger la librairie en 32 bit pour voir si ça marche. Si ça marche, le problème vient de la dll.
Partager