Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Open default browser in Windows XP using API??

Posted on 2003-03-14
7
Medium Priority
?
141 Views
Last Modified: 2010-05-01
Does anyone know how I can open the default browser in Windows XP??
The following code worked in Windows 2000, but not in XP, any ideas???

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

Dim l As Long
l = ShellExecute(0, vbNullString, "blank.html", vbNullString, vbNullString, vbNormal)
0
Comment
Question by:simon780
  • 4
  • 2
7 Comments
 
LVL 10

Expert Comment

by:aeklund
ID: 8136803
Try this:

l = ShellExecute(0, "open", "blank.html", vbNullString, vbNullString, vbNormal)
0
 

Author Comment

by:simon780
ID: 8137431
aeklund
It didn't work, thanks anyway
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8137503
a liitle modification:

Try this:

l = ShellExecute(0, "open", "about:blank", vbNullString, vbNullString, vbNormal)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8137524
i did a test and it works on 2000/XP
0
 

Author Comment

by:simon780
ID: 8138221
to Richie_Simonetti

Thx it works!!!
but it doesn't work with the URL....

l = ShellExecute(0, "open", "http://yahoo.com", vbNullString, vbNullString, vbNormal)

it doesn't work, the browser doesn't come up

any solutions??? thx!!
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 8138522
i have no problems with this:
Dim l As Long
l = ShellExecute(0, "open", "http://www.yahoo.com", vbNullString, vbNullString, vbNormal)
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8231781
Simon780, i WILL remember you.
Cheers
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question