Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need more help trying to launch a browser from textbox!! 1

Status
Not open for further replies.

greenhorn

Programmer
Apr 19, 2001
8
CA
I need more help trying to launch a browser from textbox!!
this is the code I have so far:

General declaration:
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

txtDist_Web textbox click event:
ShellExecute(Me.hwnd, "open", txtDist_Web.Text, "", 0, SW_SHOWNORMAL)

This is the error I get:
Function cal on left hand side of assignment must return Variant or Object

Any help????????
 
Take off the parens. You are doing a call, not a function. If you want a function, leave it as it is but add a variant on the left.
Code:
Call ShellExecute(Me.hwnd, "open", txtDist_Web.Text, "", 0, SW_SHOWNORMAL)
OR
ShellExecute Me.hwnd, "open", txtDist_Web.Text, "", 0, SW_SHOWNORMAL
OR
Dim var as Variant
var = ShellExecute(Me.hwnd, "open", txtDist_Web.Text, "", 0, SW_SHOWNORMAL)
 
That did it!! thanks a lot!!!

This is the best site!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top