OVH Cloud OVH Cloud

Ouverture des fichiers via ComboBox

3 réponses
Avatar
negrozoldik
Bonjour,

j aurai besoin de votre coup de pouce afin d'affecter l fichier sélectionner dans l comboBox au nom du fichier à ouvrir:

Private Sub CommandButton1_Click()
comboBox1.value= "nomfichier"
ThisWorkbook.FollowHyperlink "C:ANAMloisnomfichier.pdf"
End Sub

merci.

3 réponses

Avatar
Jacky
Bonjour,

Ceci peut-être
Les liens hypertexte sont dans l'exemple en "feuil1!a2:a5"
L'adresse de ces cellules est préalablement chargée dans le combobox
'------------------
Private Sub CommandButton1_Click()
Sheets("feuil1").Cells.Hyperlinks(Application.Match(ComboBox1.Value, [a2:a5], 0)).Follow True
End Sub
'------------------

--
Salutations
JJ


"negrozoldik" a écrit dans le message de news:

Bonjour,

j aurai besoin de votre coup de pouce afin d'affecter l fichier sélectionner
dans l comboBox au nom du fichier à ouvrir:

Private Sub CommandButton1_Click()
comboBox1.value= "nomfichier"
ThisWorkbook.FollowHyperlink "C:ANAMloisnomfichier.pdf"
End Sub

merci.
Avatar
Jacky
Sheets("feuil1").Cells(Application.Match(ComboBox1.Value, [a1:a5], 0), 1).Hyperlinks(1).Follow True

--
Salutations
JJ


"Jacky" a écrit dans le message de news: mee1eb$agd$
Bonjour,

Ceci peut-être
Les liens hypertexte sont dans l'exemple en "feuil1!a2:a5"
L'adresse de ces cellules est préalablement chargée dans le combobox
'------------------
Private Sub CommandButton1_Click()
Sheets("feuil1").Cells.Hyperlinks(Application.Match(ComboBox1.Value, [a2:a5], 0)).Follow True
End Sub
'------------------

--
Salutations
JJ


"negrozoldik" a écrit dans le message de news:

Bonjour,

j aurai besoin de votre coup de pouce afin d'affecter l fichier sélectionner
dans l comboBox au nom du fichier à ouvrir:

Private Sub CommandButton1_Click()
comboBox1.value= "nomfichier"
ThisWorkbook.FollowHyperlink "C:ANAMloisnomfichier.pdf"
End Sub

merci.




Avatar
Jacky
Erreur de manip..:o(
Plutôt ceci
'----------
Private Sub CommandButton1_Click()
Sheets("feuil1").Cells(Application.Match(ComboBox1.Value, [a2:a5], 0) + 1, 1).Hyperlinks(1).Follow True
End Sub
'----------

--
Salutations
JJ