Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Opening a web page from VB6

Opening a web page from VB6

Opening a web page from VB6

What's the best way to open a web page from VB6 today? We have a command from our program's Help menu to open a HTML help document.

We had a ShellExecute command but recent Windows security updates appear to block that method.

Our developer is now proposing a solution...



However, IE is dying (if not already dead). We should open the default browser instead. Are there any suggestions how to do this?

RE: Opening a web page from VB6

You may find it useful. Just pass either URL or a valid Path with document name and you can open it in the default application:


Option Explicit

Private Sub Command1_Click()
Call OpenDocument("www.google.com")
End Sub

Public Sub OpenDocument(strDocPath As String)
Dim G As Long
G = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler " & strDocPath, vbNormalFocus)
End Sub

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Opening a web page from VB6

Thanks. We're still having issues and I think it involves "Shell". I cannot tell if this is the result of a Windows system update or if the company's IT department has applied a policy to block this. I can run all of these options in the Windows Server 2008 VM where we have installed VB6 IDE. However, as soon as I take the EXE to another system (Win 7/10) it fails.

RE: Opening a web page from VB6

The code I gave you runs OK on my VB6 on Windows10

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Opening a web page from VB6

You can try and shell NotePad.exe and see if it opens up. That would rule out the issue is accessing the web.

RE: Opening a web page from VB6

You can check if it is an issue with launching from VB by opening a command prompt and trying

explorer "https://google.com"

and see if that works

RE: Opening a web page from VB6

Following up...

This appears to have been a temporary bug with a Windows update or with an update to Sophos security software (common to all tested systems). Today, without any changes to the VB6 program, it is back to behaving as expected. Windows and Sophos software have received automatic updates since the original post.

Thanks for the troubleshooting ideas.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close