View Single Post
  #26   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Colin Hayes Colin Hayes is offline
external usenet poster
 
Posts: 465
Default How Do You Stop Annoying Excel Message Boxes?



Hi

OK Thanks for your help and patience. I do read everything you write and
do my best to implement it correctly , I promise. I did run your
suggested setup and it gave a runtime error on my machine. I just set it
up fresh and it gave the same error.

This is what I did :

1. I highlighted and defined A1:E8 as RunEXE

2. I pasted your routine into the sheet 1 code tab :

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
With Me.Parent.Names("RunEXE")
If Not Intersect(Target.Range, .RefersToRange) Is Nothing Then _
Shell Target.Range.Text, vbNormalFocus
End With
End Sub

3. I put a hyperlink address into A1 , and made sure the cell reference
in 'Place in the document is A1. Save and reopen. Tested it - worked
with no popup. Perfect.

4 I put a hyperlink address into A3 , within the RunEXE area , and made
sure the cell reference in 'Place in this document' is A3. Save and
reopen. Tested it - gave run time error pointing to this line in the
debugger :

Shell Target.Range.Text, vbNormalFocus

5. I put a hyperlink address into A5 , within the RunEXE area , and made
sure the cell reference in 'Place in this document' is A5. Save and
reopen. Tested it - gave run time error pointing to this line in the
debugger :

Shell Target.Range.Text, vbNormalFocus

In summary , it seems that the first hyperlink in the RunEXE area works
fine , but subsequent links in the same area give the error. If you can
advise on this , I'd be grateful.

I'm sure you will wish to abandon me with exasperation now , but I'm
working hard to interpret your advice given the limits of my expertise ,
I promise.

Thanks again.






In article
,
Harlan Grove writes
Colin Hayes wrote...
...
As I understand it now , this is the routine :

1. I'll need to attribute Names to individual cells in the region I
want to use. So for example , I might Name A1 to 'CellA1' and A2 to
'CellA2'


Not exactly. Each cell containing a hyperlink should display something
different than any of the other cells. NONE of the cells that would
contain hyperlinks need to have defined names referring to them. You
only need to define a name for (ideally) the smallest range containing
the cells with hyperlinks you want to process through the
FollowHyperlink event handler.

Repeat: NONE of the individual cells containing hyperlinks NEEDS to be
named, i.e., given a defined name.

2. Then I set up individual hyperlinks within each cell , setting
the 'place in this cell' value to the Name of the cell that the
hyperlink is in.


'Place in This DOCUMENT'?

I suppose you could do this, but all you need to do is enter each
cell's own cell addresses as their cell reference.

3, Then in the sheet tab I place this code :

...

Your code might work, but it's unreasonably repetitive and fragile.

I already provided a working setup - tested on my own system. If you
haven't tried it, consider doing so. If you don't like it, perhaps
someone else could provide you with something you'd like better.