Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VB Code to link to website | Excel Worksheet Functions | |||
Dynamic link to website | Excel Worksheet Functions | |||
Link to website not working... | Excel Discussion (Misc queries) | |||
Loading website from userform | Excel Programming | |||
VBA - link to website | Excel Programming |