Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default open web page by clicking label1 of the form1

Hi,
i am trying to open a web page, let's say www.google.com, by clicking
label in the form1. In simple words, form1 has label1 and caption is
www.google.com...i am trying to launch the web page with www.google.com
by clicking the label1. Is it possible?

your help will highly be appreciated.
Thank you.

musa.biralo

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default open web page by clicking label1 of the form1

Muso,
Here's one way:

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 Label1_Click()
Call ShellExecute(0&, vbNullString, Label1.Caption, vbNullString,
vbNullString, vbNormalFocus)
End Sub

NickHK

"musa.biralo" wrote in message
ups.com...
Hi,
i am trying to open a web page, let's say www.google.com, by clicking
label in the form1. In simple words, form1 has label1 and caption is
www.google.com...i am trying to launch the web page with www.google.com
by clicking the label1. Is it possible?

your help will highly be appreciated.
Thank you.

musa.biralo



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default open web page by clicking label1 of the form1

Another way:

Option Explicit
Private Sub Label1_Click()
ThisWorkbook.FollowHyperlink Address:="http://" & Me.Label1.Caption
End Sub



"musa.biralo" wrote:

Hi,
i am trying to open a web page, let's say www.google.com, by clicking
label in the form1. In simple words, form1 has label1 and caption is
www.google.com...i am trying to launch the web page with www.google.com
by clicking the label1. Is it possible?

your help will highly be appreciated.
Thank you.

musa.biralo


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default open web page by clicking label1 of the form1

Thanks a Bunch....Nick
it worked...
musa.biralo


NickHK wrote:
Muso,
Here's one way:

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 Label1_Click()
Call ShellExecute(0&, vbNullString, Label1.Caption, vbNullString,
vbNullString, vbNormalFocus)
End Sub

NickHK

"musa.biralo" wrote in message
ups.com...
Hi,
i am trying to open a web page, let's say www.google.com, by clicking
label in the form1. In simple words, form1 has label1 and caption is
www.google.com...i am trying to launch the web page with www.google.com
by clicking the label1. Is it possible?

your help will highly be appreciated.
Thank you.

musa.biralo


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default open web page by clicking label1 of the form1

Cool...thanks Dave
short and sweet!

Can we assign a mouse pointer like "hand"? Currently it's has the
default regular one.
Let's say i chose one of the pointer from my computer. will that be
available to my friends computer?

Just curious...

thanks again
musa.biralo


Dave Peterson wrote:
Another way:

Option Explicit
Private Sub Label1_Click()
ThisWorkbook.FollowHyperlink Address:="http://" & Me.Label1.Caption
End Sub



"musa.biralo" wrote:

Hi,
i am trying to open a web page, let's say www.google.com, by clicking
label in the form1. In simple words, form1 has label1 and caption is
www.google.com...i am trying to launch the web page with www.google.com
by clicking the label1. Is it possible?

your help will highly be appreciated.
Thank you.

musa.biralo


--

Dave Peterson




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default open web page by clicking label1 of the form1

Yep. You can use any .cur file that you want. In my simple tests, it was saved
in the workbook.

I went into the VBE and clicked on the Label.
I showed its property window (hit F4)
I changed the MousePointer property to 99 (fmMousePointerCustom)
I clicked on the MouseIcon and browsed to my favorite .cur file (hand.cur???).

It seemed to work ok.


"musa.biralo" wrote:

Cool...thanks Dave
short and sweet!

Can we assign a mouse pointer like "hand"? Currently it's has the
default regular one.
Let's say i chose one of the pointer from my computer. will that be
available to my friends computer?

Just curious...

thanks again
musa.biralo

Dave Peterson wrote:
Another way:

Option Explicit
Private Sub Label1_Click()
ThisWorkbook.FollowHyperlink Address:="http://" & Me.Label1.Caption
End Sub



"musa.biralo" wrote:

Hi,
i am trying to open a web page, let's say www.google.com, by clicking
label in the form1. In simple words, form1 has label1 and caption is
www.google.com...i am trying to launch the web page with www.google.com
by clicking the label1. Is it possible?

your help will highly be appreciated.
Thank you.

musa.biralo


--

Dave Peterson


--

Dave Peterson
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
can't open file by double clicking on it Dgoff Excel Discussion (Misc queries) 3 August 23rd 09 04:50 PM
How to populate Label1.Caption with a variable's value Dave O Excel Discussion (Misc queries) 3 April 25th 08 03:20 PM
Label1 Jennifer Dixon Excel Discussion (Misc queries) 1 March 12th 08 02:12 PM
Change Label1.Caption Soniya[_4_] Excel Programming 4 February 13th 06 10:18 AM
How can you open a tab(Sheet5) by clicking on particular cell say. Suren Suthar Excel Programming 3 February 20th 05 10:28 PM


All times are GMT +1. The time now is 08:21 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"