Solved [EO] Website

How do I make a code that when they click my lblNews  it goes to my site?

@Coolguy6318:

How do I make a code that when they click my lblNews  it goes to my site?

This might help:

http://www.youtube.com/watch?v=e4W1fI8zmKY

i typed

Private Sub lblNews_Click()
webbrowser1.navigate “http://godofdistruction.webs.com
End Sub

when i run it(f5) and click the lable i get run time error 424 object required

O its working now i just had to make a new form with a web browser in it xD

@Coolguy6318:

O its working now I just had to make a new form with a web browser in it xD

God no, don’t do that. Follow my link and have it open up the default webbrowser.

The IE control is messy and disgusting.

When i put

Private Sub lblNews_Click()
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

' Open the default browser on a given URL
' Returns True if successful, False otherwise

Public Function OpenBrowser(ByVal URL As String) As Boolean
    Dim res As Long

    ' it is mandatory that the URL is prefixed with http:// or https://
    If InStr(1, URL, "http", vbTextCompare) <> 1 Then
        URL = "http://" & URL
    End If

    res = ShellExecute(0&, "open", URL, vbNullString, vbNullString, _
        vbNormalFocus)
    OpenBrowser = (res > 32)
End Function

i get compile error  only comments may appear after End sub, End Function or end property

You’re an idiot.

Im new at this  :icon_crap:

@Coolguy6318:

Im new at this  :icon_crap:

Then go read up on the basics of VB6 before asking people to do everything for you.

Ok its working now i just had 2 change it to this

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

' Open the default browser on a given URL
' Returns True if successful, False otherwise

Public Function OpenBrowser(ByVal URL As String) As Boolean
    Dim res As Long

    ' it is mandatory that the URL is prefixed with http:// or https://
    If InStr(1, URL, "http", vbTextCompare) <> 1 Then
        URL = "http://" & URL
    End If

    res = ShellExecute(0&, "open", URL, vbNullString, vbNullString, _
        vbNormalFocus)
    OpenBrowser = (res > 32)
End Function

Private Sub lblNews_Click()
Call OpenBrowser("http://godofdistruction.webs.com/apps/blog")
End Sub

Thanks for help 🙂

Log in to reply