
Open Web Browser from VBA
Thank you so much for your assistance! I got the code to
work when I used a string variable to specify the URL.
Thanks again! You saved me a lot of trial-and-error! Nate
Quote:
>-----Original Message-----
>Hi,
>The only way that I know is to use the ShellExecute API.
>For example,
>Public Declare Function ShellExecute Lib "shell32.dll"
Alias "ShellExecuteA"
Quote:
>(ByVal hwnd As Long, ByVal lpOperation As String, ByVal
lpFile As String,
>ByVal lpParameters As String, ByVal lpDirectory As
String, ByVal nShowCmd As
Quote:
>Long) As Long
>Dim ReturnValue As Long
>Private Sub Command1_Click()
>Dim ReturnValue As Long
> ReturnValue = ShellExecute
(Me.hwnd, "", "www.microsoft.com", "", "", 0&)
Quote:
>End Sub
>(simplest form). Use a string variable to specify the
URL, unless a literal
Quote:
>is sufficient.
>--
>Richard Grier (Microsoft Visual Basic MVP)
>See www.hardandsoftware.net for contact information.
>Author of Visual Basic Programmer's Guide to Serial
Communications, 3rd
>Edition ISBN 1-890422-27-4 (391 pages) published February
2002.
>.