+ Reply to Thread
Results 1 to 4 of 4

Activate Embedded Chart from Listbox

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2003 / 2007
    Posts
    2

    Post Activate Embedded Chart from Listbox

    I'm fairly new to VBA but have built out the code to populate a userform listbox, select a chart, and export the chart if the worksheet is active. It works great. But, it can't find the chartobject if the worksheet is not manually selected first and results in a error. Is it possible to determine the sheet name for the embedded chart and pass that to a variable? My code is below to select the chart - simply, I'm trying to replace the "ActiveSheet" with a variable.

    Please Login or Register  to view this content.
    Thanks!
    /Ron

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Activate Embedded Chart from Listbox

    I reckon it's probably easiest to use a two column listbox and when you populate it with chart names add the worksheet name too in the second column-you can hide it if you don't want it displayed.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    10-10-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2003 / 2007
    Posts
    2

    Re: Activate Embedded Chart from Listbox

    Thanks JP for the response. That's where I'm unclear - does the embedded chart include its worksheet name? Or, are you suggesting that the user select the worksheet and then select the chart in the listbox?

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Activate Embedded Chart from Listbox

    no I'm suggesting that if you store the worksheet name when you load the listbox your code can activate the sheet before trying to select the chart

+ 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.6.0 RC 1