Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Help with VB problem

Hi, Thank you for looking at this post, but i am currently trying to create a button within VB6 that will open an Internet Explorer window and display the home page from the works admin control panel, using VB6 forms, but i have tried different things but nothing seems to work, please can someone help me with this, it would very much appriciate it.

Cheers

Shuka
[381 byte] By [shuka79] at [2007-11-11 10:12:20]
# 1 Re: Help with VB problem
well post what u have tried and we will help u correct it , and gives u new ideas .
Amahdy at 2007-11-11 17:23:01 >
# 2 Re: Help with VB problem
What is the URL of the page you want to open?
Phil Weber at 2007-11-11 17:24:01 >
# 3 Re: Help with VB problem
I'm currently trying using

Private Sub Command1_Click()

Command1.OpenURL(" http://uk.yahoo.com")

End Sub

Have also tried using Shell = iexplorer

If you can help it would be great.
shuka79 at 2007-11-11 17:25:00 >
# 4 Re: Help with VB problem
Try this:
http://www.freevbcode.com/ShowCode.Asp?ID=12
Phil Weber at 2007-11-11 17:26:04 >
# 5 Re: Help with VB problem
Thank you for the example, so once the code is over, do you have to call the function from the button on the click commend?

Cheers

Shuka
shuka79 at 2007-11-11 17:27:03 >
# 6 Re: Help with VB problem
oops :o
Lobelia Overhil at 2007-11-11 17:28:02 >
# 7 Re: Help with VB problem
I have copy the code over but still unable to get it to work, please can anyone help at all

Thanks in advanced

Shuka
shuka79 at 2007-11-11 17:29:03 >
# 8 Re: Help with VB problem
sometimes anti-spyware programmes (like ZONEALARM) pop-up an alert that mention that the program is trying to comunicate with IE.exe for example , accept or deny , if u choose deny the program will not be able to communicate with the IE, and if you do that at debug mode, the vb6 will be never able to open an internet explorer website .. untill u remove it from the blocked list for example ...
this is firstly ,secondly check if u have choose the right place of your installed IE location ..
Finally in phil's link, check that u have called the function with the right parameters;
for example make a button, and in it's _onclick() event put this :

OpenLocation "WWW.AMAHDY.COM", 3
Amahdy at 2007-11-11 17:30:06 >
# 9 Re: Help with VB problem
I tried the code that Phil posted the link to and it worked just fine. In fact I even made the paramaters optional and with default values. I have attached the little test program that I created. So try it out.
Ron Weller at 2007-11-11 17:31:14 >
# 10 Re: Help with VB problem
Try this code I think it will work with you

Option Explicit
Private Const SW_SHOW = 1

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

Private Sub Navigate(frm As Form, ByVal Document_Name As String)
ShellExecute frm.hwnd, "Open", Document_Name, "", "", SW_SHOW
End Sub

Private Sub Command1_Click()
Navigate Me, "http://www.dev-archive.com"
End Sub
amrelsaqqa at 2007-11-11 17:32:15 >