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
Private Sub UserForm_Initialize()
Dim x&
With Feuil1
For x = 2 To Range("a65536").End(xlUp).Row
ComboBox1.AddItem .Range("a" & x)
Next x
End With
End Sub
Private Sub CommandButton1_Click()
Dim site$
site = ComboBox1.Text
ShellExecute 0, vbNullString, site, vbNullString, vbNullString, 0
End Sub
'Activer la référence Microsoft Internet Controls
Private Sub CommandButton1_Click()
Dim IE As Object
Dim site$
On Error GoTo fin
Set IE = CreateObject("InternetExplorer.Application")
site = ComboBox1.Text
IE.Visible = True
IE.Navigate site
Do Until IE.ReadyState = 2
DoEvents
Loop
IE.Quit
Set IE = Nothing
fin:
Exit Sub
End Sub
Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
ActiveWorkbook.FollowHyperlink Address:=Me.TextBox1, NewWindow:=True
Unload Me
End Sub
Private Sub CommandButton1_Click()
Dim URL$: URL = TextBox1.Text
On Error GoTo Bad_URL
ActiveWorkbook.FollowHyperlink Address:=URL, NewWindow:=True
Exit Sub
Bad_URL:
MsgBox "Impossible d'accéder à : " & URL, vbCritical, "ERREUR"
End Sub
Bonjour Staple
Et moi, 2010 n'aime pas followhyperlinks. Il aime juste les Follo's. Mais si elle à plusieurs liens mieux vaut un combo, plutôt que d'écrire à chaque fois un lien.
NewWindow:=True
N...Alors, on n'a pas taquiné la touche F1... Sinon tu aurais vu que ...