+ Reply to Thread
Results 1 to 2 of 2

Thread: Add ActiveX Control with VBA

  1. #1
    Registered User
    Join Date
    10-06-2009
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2007
    Posts
    34

    Add ActiveX Control with VBA

    Hi,

    I've been searching around the forum but can't find an answer for this.

    I have a macro that builds an index list of certain sheets in my workbook. It refreshes each time a new sheet is added or removed.

    For each index item, I want to add an activeX image control which, when clicked, links to another sheet.

    I know how to do this manually, i.e. by adding the image control, and then using a private sub like the following (in the code for that sheet):

    Private Sub GoToHome_Click()
    
    Worksheets("SheetX").Activate
    
    End Sub
    What I want to know is if there is a way use VBA to automate the creation of this image control and write the code for the click event (such that I can include it in the macro which refreshes the index list)?

    I know that I can use a hyperlink to achieve the same result (of navigating to another sheet) but the use of the activeX image control is something that I want for stylistic reasons.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,351

    Re: Add ActiveX Control with VBA

    What 'stylistic reasons' exactly.

    Can you not use a shape with picture fill and a hyperlink?
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0