XL 2019 Ouvre lien sur 64 bits

Temjeh

XLDnaute Accro
Supporter XLD
Bonjour et merci d'avance

J'ai un code qui ouvre un lien internet avec navigateur par défaut.
Il fonctionne bien sur mon ordinateur mais chez mon ami il mentionne une erreur 64 bit.

Existe-t-il une façon universelle?

Merci de votre temps!

Temjeh

VB:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

ShellExecute 0, "open", "https://drive.google.com/drive/...", "", "", 1
 

kiki29

XLDnaute Barbatruc
Salut, j'ai trouvé ceci:
VB:
#If VBA7 Then
    Public Declare PtrSafe Function ShellExecute Lib "shell32.dll" _
           Alias "ShellExecuteA" (ByVal hwnd As LongPtr, _
                                  ByVal lpOperation As String, _
                                  ByVal lpFile As String, _
                                  ByVal lpParameters As String, _
                                  ByVal lpDirectory As String, _
                                  ByVal nShowCmd As Long) As LongPtr
#Else
    Public Declare Function ShellExecute Lib "shell32.dll" _
                                         Alias "ShellExecuteA" (ByVal hwnd As Long, _
                                                                ByVal lpOperation As String, _
                                                                ByVal lpFile As String, _
                                                                ByVal lpParameters As String, _
                                                                ByVal lpDirectory As String, _
                                                                ByVal nShowCmd As Long) As Long
#End If
 
Dernière édition:

Discussions similaires

Réponses
1
Affichages
1 K
Compte Supprimé 979
C

Statistiques des forums

Discussions
312 177
Messages
2 085 972
Membres
103 073
dernier inscrit
MSCHOE16