Solved

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

Posted on 2014-07-28
3
326 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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

947 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

22 Experts available now in Live!

Get 1:1 Help Now