Solved

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

Posted on 2014-07-28
3
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 51

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 Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
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…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

752 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