Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Command for userform to load website link

Hi

I have made a label for my site within my userform, how can I make it load my
site?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Command for userform to load website link


Hello Danny Boy,

This macro will launch your default browser and connect you with your
site. There are to parts to this. The call to macro will be placed
inside your label's Click Event (the default). The macro code must be
placed in a VBA module in your workbook.

Macro Code for Module:
_____________________________

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

Public Sub OpenURL(ByRef URL As String)
Dim RetVal
RetVal = ShellExecute(0&, "open", URL, vbNullString, vbNullString, 1)
If RetVal < 33 Then MsgBox "An error occurred while opening the site."
End Sub
_____________________________


Label Click Event Code:
_____________________________
Sub Label1_Click()
Call OpenURL("http:/www.excelforum.com/")
End Sub
_____________________________

Be sure to change the label name from Label1 to your label's name and
the URL to what you using.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=506217

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Command for userform to load website link

Thanks Leith,

Although I found another method,

I have the address in a cell within my workbook so I called it from my cell
as below


Private Sub Image1_Click()
Range("v99").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB Code to link to website EA Excel Worksheet Functions 1 October 3rd 07 09:15 PM
Dynamic link to website Rajan Iyer Excel Worksheet Functions 2 July 31st 07 08:45 AM
Link to website not working... mercuriocs Excel Discussion (Misc queries) 1 March 31st 07 04:28 PM
Loading website from userform Danny Boy via OfficeKB.com Excel Programming 0 January 29th 06 04:09 PM
VBA - link to website Accountant@DDI Excel Programming 1 May 18th 04 12:18 PM


All times are GMT +1. The time now is 10:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"