Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-07-28
3
Medium Priority
?
360 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:Murray Brown
  • 2
3 Comments
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 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:Murray Brown
ID: 40224631
Hi. What do I declare oPic as?
Dim oPic as Object
0
 

Author Closing Comment

by:Murray Brown
ID: 40224690
Thanks very much
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

824 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