Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
simply lost on hyperlinks
from earlier post still trying to figure a hyperlink called from a
command button where i dont have to have cell displaying the hyperlink url, which is bogus anyway because the hyperlink url is being changed programatically anyway the basics of what i'm using this was generously suggested keepIt Cool, still there keepIt? Sub ff() Dim r As Range Set r = [b3] r.Hyperlinks.Add r, "", r.Address,"ClickMe" End Sub here is what i'm trying Private Sub CommandButton3_Click() Dim r As Range Set r = [o18] r.Hyperlinks.Add r, "", ivGraphUrl, "" ' ivGraphUrl is a public var that i set activeworksheet.followhyperlink r end sub so the code works in that i get the web page in a new window but i still get the hyperlink showing in cell 'o18' and not sure why? and while on the subject..... no sure about the r.hyperlinks.add syntax my object browser has this object.Add(Anchor, Address, SubAddress, ScreenTip, TextToDisplay) it seems to be saying add a hyperlink to cell 018 twice, once in the 'r.' and secondly the first parameter 'r' ????? and i'm really using the sub address instead of the address, they are interchangeable?? it seems the worksheet has an array of hyperlinks but i'm not adding the hl to the sheet array directly but to a cell, there is someway to tell what member of the hl array is for each cell?? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
simply lost on hyperlinks
yep.. I'm here.
My idea never included a commandbutton????... and the code you list is certainly not mine :( If you want to have a commandbutton that jumps to a website sub CommandButton3_Click() ActiveWorkbook.followHyperlink("http://www.microsoft.som") end sub BUT: your original question was: you wanted hyperlinks where the user couldnt see or edit the address of the hyperlink. My solutions was to create bogus hyperlinks The bogus hyperlink points to itself, so if the user clicks on it it will jump to itself (do nothing) ... AND trigger a followhyperlink event.Then use the event handler to redirect 'traffic' Sub ThisIsJustSomeDummyCodeToQuicklyInsertHyperLinksFo rTesting() Dim r As Range For Each r In [a1:a4].Cells r.Hyperlinks.Add r, "", r.Address, "Tooltip", "ClickMe" Next End Sub Now open the code module for sheet1 (double click Sheet1 in VBE project explorer. Here we can build the event HANDLER for the followhyperlink event. Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) 'Based on WHICH HL was clicked we can now go whereever we want. Select Case Target.Range.Address Case "$A$1" ActiveWorkbook.FollowHyperlink ("http://www.microsoft.com") Case "$A$2" ActiveWorkbook.FollowHyperlink ("http://www.adobe.com") Case "$A$3" ActiveWorkbook.FollowHyperlink ("http://www.google.com") Case "$A$4" ActiveWorkbook.FollowHyperlink ("http://www.xlSupport.com") End Select End Sub Capisce? keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool bbxrider wrote: from earlier post still trying to figure a hyperlink called from a command button where i dont have to have cell displaying the hyperlink url, which is bogus anyway because the hyperlink url is being changed programatically anyway the basics of what i'm using this was generously suggested keepIt Cool, still there keepIt? Sub ff() Dim r As Range Set r = [b3] r.Hyperlinks.Add r, "", r.Address,"ClickMe" End Sub here is what i'm trying Private Sub CommandButton3_Click() Dim r As Range Set r = [o18] r.Hyperlinks.Add r, "", ivGraphUrl, "" ' ivGraphUrl is a public var that i set activeworksheet.followhyperlink r end sub so the code works in that i get the web page in a new window but i still get the hyperlink showing in cell 'o18' and not sure why? and while on the subject..... no sure about the r.hyperlinks.add syntax my object browser has this object.Add(Anchor, Address, SubAddress, ScreenTip, TextToDisplay) it seems to be saying add a hyperlink to cell 018 twice, once in the 'r.' and secondly the first parameter 'r' ????? and i'm really using the sub address instead of the address, they are interchangeable?? it seems the worksheet has an array of hyperlinks but i'm not adding the hl to the sheet array directly but to a cell, there is someway to tell what member of the hl array is for each cell?? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
simply lost on hyperlinks
hope this gets there, first reply from xnews, thanx for the tip on xnews
command button now working by 'itself' without any associated hyperlink sorry bout the confusion, if not made clear but that was always the idea to use a command button, thought it could/should/would be that simple, got caught up in the hyperlink,thinking it was necessary, but many thanks again, now understanding hyperlinks better and see what you were doing ran the code to create the dummy hyperlinks in my sheet, not sure what the r.address is, its just a bogus variable so the address will be blank, therefore the cell is blank?? .address is somehow a property of a range object?? and i didn't get the tool tip and text to display for the cells in the range, but not really important since i now have the command button functioning as wanted keepITcool wrote in : yep.. I'm here. My idea never included a commandbutton????... and the code you list is certainly not mine :( If you want to have a commandbutton that jumps to a website sub CommandButton3_Click() ActiveWorkbook.followHyperlink("http://www.microsoft.som") end sub BUT: your original question was: you wanted hyperlinks where the user couldnt see or edit the address of the hyperlink. My solutions was to create bogus hyperlinks The bogus hyperlink points to itself, so if the user clicks on it it will jump to itself (do nothing) ... AND trigger a followhyperlink event.Then use the event handler to redirect 'traffic' Sub ThisIsJustSomeDummyCodeToQuicklyInsertHyperLinksFo rTesting() Dim r As Range For Each r In [a1:a4].Cells r.Hyperlinks.Add r, "", r.Address, "Tooltip", "ClickMe" Next End Sub Now open the code module for sheet1 (double click Sheet1 in VBE project explorer. Here we can build the event HANDLER for the followhyperlink event. Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) 'Based on WHICH HL was clicked we can now go whereever we want. Select Case Target.Range.Address Case "$A$1" ActiveWorkbook.FollowHyperlink ("http://www.microsoft.com") Case "$A$2" ActiveWorkbook.FollowHyperlink ("http://www.adobe.com") Case "$A$3" ActiveWorkbook.FollowHyperlink ("http://www.google.com") Case "$A$4" ActiveWorkbook.FollowHyperlink ("http://www.xlSupport.com") End Select End Sub Capisce? keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool bbxrider wrote: from earlier post still trying to figure a hyperlink called from a command button where i dont have to have cell displaying the hyperlink url, which is bogus anyway because the hyperlink url is being changed programatically anyway the basics of what i'm using this was generously suggested keepIt Cool, still there keepIt? Sub ff() Dim r As Range Set r = [b3] r.Hyperlinks.Add r, "", r.Address,"ClickMe" End Sub here is what i'm trying Private Sub CommandButton3_Click() Dim r As Range Set r = [o18] r.Hyperlinks.Add r, "", ivGraphUrl, "" ' ivGraphUrl is a public var that i set activeworksheet.followhyperlink r end sub so the code works in that i get the web page in a new window but i still get the hyperlink showing in cell 'o18' and not sure why? and while on the subject..... no sure about the r.hyperlinks.add syntax my object browser has this object.Add(Anchor, Address, SubAddress, ScreenTip, TextToDisplay) it seems to be saying add a hyperlink to cell 018 twice, once in the 'r.' and secondly the first parameter 'r' ????? and i'm really using the sub address instead of the address, they are interchangeable?? it seems the worksheet has an array of hyperlinks but i'm not adding the hl to the sheet array directly but to a cell, there is someway to tell what member of the hl array is for each cell?? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
simply lost on hyperlinks
oops, had a bad range, now getting the cell text and tool tip
and getting values for r and r.address thanks again keepITcool wrote in : yep.. I'm here. My idea never included a commandbutton????... and the code you list is certainly not mine :( If you want to have a commandbutton that jumps to a website sub CommandButton3_Click() ActiveWorkbook.followHyperlink("http://www.microsoft.som") end sub BUT: your original question was: you wanted hyperlinks where the user couldnt see or edit the address of the hyperlink. My solutions was to create bogus hyperlinks The bogus hyperlink points to itself, so if the user clicks on it it will jump to itself (do nothing) ... AND trigger a followhyperlink event.Then use the event handler to redirect 'traffic' Sub ThisIsJustSomeDummyCodeToQuicklyInsertHyperLinksFo rTesting() Dim r As Range For Each r In [a1:a4].Cells r.Hyperlinks.Add r, "", r.Address, "Tooltip", "ClickMe" Next End Sub Now open the code module for sheet1 (double click Sheet1 in VBE project explorer. Here we can build the event HANDLER for the followhyperlink event. Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) 'Based on WHICH HL was clicked we can now go whereever we want. Select Case Target.Range.Address Case "$A$1" ActiveWorkbook.FollowHyperlink ("http://www.microsoft.com") Case "$A$2" ActiveWorkbook.FollowHyperlink ("http://www.adobe.com") Case "$A$3" ActiveWorkbook.FollowHyperlink ("http://www.google.com") Case "$A$4" ActiveWorkbook.FollowHyperlink ("http://www.xlSupport.com") End Select End Sub Capisce? keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool bbxrider wrote: from earlier post still trying to figure a hyperlink called from a command button where i dont have to have cell displaying the hyperlink url, which is bogus anyway because the hyperlink url is being changed programatically anyway the basics of what i'm using this was generously suggested keepIt Cool, still there keepIt? Sub ff() Dim r As Range Set r = [b3] r.Hyperlinks.Add r, "", r.Address,"ClickMe" End Sub here is what i'm trying Private Sub CommandButton3_Click() Dim r As Range Set r = [o18] r.Hyperlinks.Add r, "", ivGraphUrl, "" ' ivGraphUrl is a public var that i set activeworksheet.followhyperlink r end sub so the code works in that i get the web page in a new window but i still get the hyperlink showing in cell 'o18' and not sure why? and while on the subject..... no sure about the r.hyperlinks.add syntax my object browser has this object.Add(Anchor, Address, SubAddress, ScreenTip, TextToDisplay) it seems to be saying add a hyperlink to cell 018 twice, once in the 'r.' and secondly the first parameter 'r' ????? and i'm really using the sub address instead of the address, they are interchangeable?? it seems the worksheet has an array of hyperlinks but i'm not adding the hl to the sheet array directly but to a cell, there is someway to tell what member of the hl array is for each cell?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Lost hyperlinks Excell 2003-HELP | Excel Discussion (Misc queries) | |||
Hyperlinks were lost | Excel Discussion (Misc queries) | |||
filtering simply | New Users to Excel | |||
Simply Accounting | Excel Discussion (Misc queries) | |||
can this be done simply ? | Excel Discussion (Misc queries) |