Open a webpage from VBA
Solved
fourvin
Posted messages
286
Status
Membre
-
fourvin Posted messages 286 Status Membre -
fourvin Posted messages 286 Status Membre -
Good evening,
I am using Office 2007 and I am looking for a way to open a given Internet URL from a VBA procedure.
For example, how can I use VBA to open the URL http://www.commentcamarche.net in my default browser?
Thank you in advance for the answers.
Configuration: Windows 7 / Firefox 3.6.10
I am using Office 2007 and I am looking for a way to open a given Internet URL from a VBA procedure.
For example, how can I use VBA to open the URL http://www.commentcamarche.net in my default browser?
Thank you in advance for the answers.
Configuration: Windows 7 / Firefox 3.6.10
1 réponse
Hello,
Test carried out with FF first, then IE, and then again FF as the default browser....
In a standard module:
Good night
Test carried out with FF first, then IE, and then again FF as the default browser....
In a standard module:
Option Explicit 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 Sub Open() Dim File As String File = "https://www.commentcamarche.net/" ShellExecute 0, "", File, "", "", 0 End Sub
Good night
Thank you.
I was also provided with this simplified version for Access, likely degraded, but which I had no problem using: