Fichier introuvable user64

Bonjour la communauté,

Essayant de développer un programme de réservation de chambre d’hôtel en compagnie d'un ami, nous nous retruvons confronté à un message d'erreur "erreur d'exécution 53" - Fichier introuvable user64.

il travaille à distance avec une version 32b et moi 64b alors le problème est peut être là.

Comment puis je régler ce problème d’affichage du calendrier ?

Merci pour votre aide toujours précieuse

28hotel-new-5.xlsm (117.88 Ko)

Pour pouvoir travailler en 32/64 bits, il faudrait que vos API soient déclarées comme ceci (toutes les bibliothèques API sont 32 bits et non 64 bits):

 'API ...................................................................
#If VBA7 Then
    Private Declare PtrSafe Function FindWindow& Lib "user32" _
        Alias "FindWindowA" _
        (ByVal lpClassName$, ByVal lpWindowName$)
    Private Declare PtrSafe Function ScreenToClient& Lib "user32" _
        (ByVal hWnd&, ByRef lpPoint As POINTAPI)
    Private Declare PtrSafe Function GetWindowRect& Lib "user32" _
        (ByVal hWnd&, lpRect As RECT)
    Private Declare PtrSafe Function CreateWindowEx& Lib "user32" _
        Alias "CreateWindowExA" _
        (ByVal dwExStyle&, ByVal lpClassName$, ByVal lpWindowName$, _
        ByVal dwStyle&, ByVal X&, ByVal y&, ByVal nWidth&, _
        ByVal nHeight&, ByVal hWndParent&, ByVal hMenu&, _
        ByVal hInstance&, ByRef lpParam As Any)
    Private Declare PtrSafe Function InitCommonControlsEx& Lib "comctl32" _
        (ByRef INITCOMMONCONTROLSEXData As InitCommonControlsExType)
    Private Declare PtrSafe Function DestroyWindow& Lib "user32" _
        (ByVal hWnd&)
    Private Declare PtrSafe Function SendMessage& Lib "user32" _
        Alias "SendMessageA" _
        (ByVal hWnd&, ByVal wMsg&, ByVal wParam&, ByRef lParam As Any)
    Private Declare PtrSafe Function SetWindowPos& Lib "user32" _
        (ByVal hWnd&, ByVal hWndInsertAfter&, ByVal X&, _
        ByVal y&, ByVal cx&, ByVal cy&, ByVal wFlags&)
#Else
    Private Declare Function FindWindow& Lib "user32" _
        Alias "FindWindowA" _
        (ByVal lpClassName$, ByVal lpWindowName$)
    Private Declare  Function ScreenToClient& Lib "user32" _
        (ByVal hWnd&, ByRef lpPoint As POINTAPI)
    Private Declare  Function GetWindowRect& Lib "user32" _
        (ByVal hWnd&, lpRect As RECT)
    Private Declare  Function CreateWindowEx& Lib "user32" _
        Alias "CreateWindowExA" _
        (ByVal dwExStyle&, ByVal lpClassName$, ByVal lpWindowName$, _
        ByVal dwStyle&, ByVal X&, ByVal y&, ByVal nWidth&, _
        ByVal nHeight&, ByVal hWndParent&, ByVal hMenu&, _
        ByVal hInstance&, ByRef lpParam As Any)
    Private Declare  Function InitCommonControlsEx& Lib "comctl32" _
        (ByRef INITCOMMONCONTROLSEXData As InitCommonControlsExType)
    Private Declare  Function DestroyWindow& Lib "user32" _
        (ByVal hWnd&)
    Private Declare  Function SendMessage& Lib "user32" _
        Alias "SendMessageA" _
        (ByVal hWnd&, ByVal wMsg&, ByVal wParam&, ByRef lParam As Any)
    Private Declare  Function SetWindowPos& Lib "user32" _
        (ByVal hWnd&, ByVal hWndInsertAfter&, ByVal X&, _
        ByVal y&, ByVal cx&, ByVal cy&, ByVal wFlags&)
#End If

Bonjour et merci Thev,

Je vais regarder ça de près en espérant que cela règle notre problème.

Cordialement

Bonsoir thev,

J'ai suivi vos conseils et malheureusement je rencontre le même problème pour l'ouverture du calendrier.

Je viens de tester sur un PC en 32b et effectivement cela fonctionne bien.

Voila le code corrigé :

Option Explicit

Private Declare PtrSafe Function FindWindow& Lib "user64" _

Alias "FindWindowA" _

(ByVal lpClassName$, ByVal lpWindowName$)

Private Declare PtrSafe Function ScreenToClient& Lib "user64" _

(ByVal hWnd&, ByRef lpPoint As POINTAPI)

Private Declare PtrSafe Function GetWindowRect& Lib "user64" _

(ByVal hWnd&, lpRect As RECT)

Private Declare PtrSafe Function CreateWindowEx& Lib "user64" _

Alias "CreateWindowExA" _

(ByVal dwExStyle&, ByVal lpClassName$, ByVal lpWindowName$, _

ByVal dwStyle&, ByVal X&, ByVal y&, ByVal nWidth&, _

ByVal nHeight&, ByVal hWndParent&, ByVal hMenu&, _

ByVal hInstance&, ByRef lpParam As Any)

Private Declare PtrSafe Function InitCommonControlsEx& Lib "comctl64" _

(ByRef INITCOMMONCONTROLSEXData As InitCommonControlsExType)

Private Declare PtrSafe Function DestroyWindow& Lib "user64" _

(ByVal hWnd&)

Private Declare PtrSafe Function SendMessage& Lib "user64" _

Alias "SendMessageA" _

(ByVal hWnd&, ByVal wMsg&, ByVal wParam&, ByRef lParam As Any)

Private Declare PtrSafe Function SetWindowPos& Lib "user64" _

(ByVal hWnd&, ByVal hWndInsertAfter&, ByVal X&, _

ByVal y&, ByVal cx&, ByVal cy&, ByVal wFlags&)

Private Type InitCommonControlsExType

dwSize As Long

dwICC As Long

End Type

Private Type POINTAPI

X As Long

y As Long

End Type

Private Type RECT

Left As Long

Top As Long

Right As Long

Bottom As Long

End Type

Private Type SYSTEMTIME

wYear As Integer

wMonth As Integer

wDayOfWeek As Integer

wDay As Integer

wHour As Integer

wMinute As Integer

wSecond As Integer

wMilliseconds As Integer

End Type

Private mWnd&

Public ObjetSource As Object

Merci pour votre aide

32hotel-new-1.xlsm (110.63 Ko)

Bonsoir,

Vous n'avez pas modifié les bibliothèques comme indiqué dans mon code :

user64 --> user32 et comctl64 --> comctl32.

Encore une fois, les API ne fonctionnent pas avec des bibliothèques 64 bits.

Le code que j'ai indiqué fonctionne aussi bien sur un Excel 32 bits qu'un Excel 64bits

Oup's

Trop pressé trop rapide...bref je n'avais pas tout vu.

Je viens de faire l'essai et ça fonctionne à merveille.

Merci thev

Merci la communauté une fois de plus

Rechercher des sujets similaires à "fichier introuvable user64"