Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default hyperlink - place in this document - can discover caller in target sheet?

How do you discover the caller in a sheet pointed to by a hyperlink?

If I try Application.Caller in the sheet's event Worksheet_Activate I get errors. I'm guessing that I'll need something more elaborate if I need to discover the link that called it.

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default hyperlink - place in this document - can discover caller in target sheet?

How do you discover the caller in a sheet pointed to by a hyperlink?

If I try Application.Caller in the sheet's event Worksheet_Activate I
get errors. I'm guessing that I'll need something more elaborate if
I need to discover the link that called it.

Thank you


Perhaps this event...

Worksheet_FollowHyperlink

...but there may be a better way to handle whatever it is your trying to
do. ¤Can you elaborate?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default hyperlink - place in this document - can discover caller intarget sheet?


Perhaps this event...



Worksheet_FollowHyperlink



..but there may be a better way to handle whatever it is your trying to

do. EURO Can you elaborate?


Tried that, but no go.
I have a dynamic report that is updated based on an employee selection. If you are on the report sheet, this selection is made via a combobox. It is also possible to select an employee from a roster located on another sheet.. Right now I use a hyperlink. I need to identify the caller so I can regenerate the report. It doesn't look like the hyper link will make it.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default hyperlink - place in this document - can discover caller in targetsheet?

hi,

i'm not sure to well understanding,
the Hyperlink is it into a microsoft word object (document) placed in a worksheet ?

isabelle

Le 2014-02-21 18:45, a écrit :
How do you discover the caller in a sheet pointed to by a hyperlink?

If I try Application.Caller in the sheet's event Worksheet_Activate I get errors.
I'm guessing that I'll need something more elaborate if I need to discover the link that called it.

Thank you

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default hyperlink - place in this document - can discover caller intarget sheet?

On Saturday, February 22, 2014 12:15:36 AM UTC-6, isabelle wrote:
hi,



i'm not sure to well understanding,

the Hyperlink is it into a microsoft word object (document) placed in a worksheet ?


Excel calls it a hyperlink but the option is set to a "place in this document". If you edit it, doesn't look like "hyperlink" construct. Not in the mode "place in this document" anyway.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default hyperlink - place in this document - can discover caller in targetsheet?

ok

'in ThisWorkbook

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As
Hyperlink)
MsgBox "From : " & Sh.Name & " " & Target.Parent.Address & " to : " &
Target.SubAddress
End Sub

isabelle

Le 2014-02-22 01:34, a écrit :

Excel calls it a hyperlink but the option is set to a "place in this document".
If you edit it, doesn't look like "hyperlink" construct. Not in the mode "place in this document" anyway.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default hyperlink - place in this document - can discover caller in targetsheet?

or with tab name and address separately

on ThisWorkbook

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As
Hyperlink)
MsgBox "From : " & Sh.Name & " " & Target.Parent.Address(0, 0) & Chr(10) &
Chr(10) & " To : " & Split(Target.SubAddress, "!")(0) & " " &
Split(Target.SubAddress, "!")(1)
End Sub

isabelle

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default hyperlink - place in this document - can discover caller in targetsheet?

also if you want to use variables in a standard module

'on ThisWorkbook
'------------------------------------------------------------------------------------------------------------------
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As
Hyperlink)
fromSheet = Sh.Name
fromRange = Target.Parent.Address(0, 0)
toSheet = Split(Target.SubAddress, "!")(0)
toRange = Split(Target.SubAddress, "!")(1)
Macro1
End Sub
'------------------------------------------------------------------------------------------------------------------


'on Module
'------------------------------------------------------------------------------------------------------------------
Public fromSheet As String
Public fromRange As String
Public toSheet As String
Public toRange As String


Sub Macro1()
MsgBox "From : " & fromSheet & Chr(10) & _
"range : " & fromRange & Chr(10) & _
Chr(13) & Chr(13) & _
"To : " & toSheet & Chr(10) & _
"range : " & toRange
End Sub
'------------------------------------------------------------------------------------------------------------------

isabelle
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default hyperlink - place in this document - can discover caller in target sheet?

Perhaps this event...



Worksheet_FollowHyperlink



..but there may be a better way to handle whatever it is your trying
to

do. EURO Can you elaborate?


Tried that, but no go.
I have a dynamic report that is updated based on an employee
selection. If you are on the report sheet, this selection is made
via a combobox. It is also possible to select an employee from a
roster located on another sheet. Right now I use a hyperlink. I
need to identify the caller so I can regenerate the report. It
doesn't look like the hyper link will make it.


If you impliment using a local scope defined name on the report sheet,
you can update that when the respective name on the roster list is
clicked. Then your report generator can read the name and carry on...

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Report").Names("CallerID").RefersTo = _
"=""" & Target.Parent & """"
End Sub

...where the defined name is initialized with an empty string when
created, and your report generator restores its value to an empty
string after doing its thing.

You can also have your combobox use this same mechanism so your report
generator code needs only to retrieve the name stored in 'CallerID'.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default hyperlink - place in this document - can discover caller intarget sheet?

the events were off... I apologize.


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default hyperlink - place in this document - can discover caller in target sheet?

the events were off... I apologize.

Please explain...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Hyperlink to a specific place in a document Al Excel Worksheet Functions 3 June 29th 09 05:53 PM
Hyperlink to target Leigh Excel Programming 0 July 11th 07 12:30 AM
Can I hyperlink in my sheet to a remote document on my server? Ben Excel Worksheet Functions 3 May 9th 06 05:24 PM
ERR:The target cannot handle this type of document. ?? B. [email protected] Excel Discussion (Misc queries) 1 September 26th 05 03:51 PM
the target cannot handle this type of document Shooter Excel Worksheet Functions 1 April 29th 05 07:54 PM


All times are GMT +1. The time now is 12:26 AM.

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

About Us

"It's about Microsoft Excel"