Solved

VB.net Excel Add-in Add Hyperlink to picture added to sheet

Posted on 2014-07-28
3
324 Views
Last Modified: 2014-07-28
Hi
How do I alter the following code to include a hyperlink from the picture added to Excel
that takes the user to another page when clicked on

                       oTop = Globals.ThisAddIn.Application.Cells(r + 2, c + 1).Top
                                oLeft = Globals.ThisAddIn.Application.Cells(r + 2, c + 1).Left

                                Globals.ThisAddIn.Application.ActiveSheet.Shapes.AddPicture(oFile, _
                                Microsoft.Office.Core.MsoTriState.msoFalse, _
                                Microsoft.Office.Core.MsoTriState.msoCTrue, oLeft, oTop, 80, 80)
0
Comment
Question by:murbro
  • 2
3 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40224605
Hi,

pls try

   oPic = Globals.ThisAddIn.Application.ActiveSheet.Shapes.AddPicture(oFile, _
                                 Microsoft.Office.Core.MsoTriState.msoFalse, _
                                 Microsoft.Office.Core.MsoTriState.msoCTrue, oLeft, oTop, 80, 80)

    Globals.ThisAddIn.Application.ActiveSheet.Hyperlinks.Add Anchor:=Globals.ThisAddIn.Application.ActiveSheet.Shapes(oPic.Name), Address:="", SubAddress:="YourSheet!A1"

Regards
0
 

Author Comment

by:murbro
ID: 40224631
Hi. What do I declare oPic as?
Dim oPic as Object
0
 

Author Closing Comment

by:murbro
ID: 40224690
Thanks very much
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now