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.

If ListBox1.ListIndex = -1 Then
MsgBox ("Please Select a Chart to Export")

Else
Set ActChar = ActiveSheet.ChartObjects(ListBox1.Text).Chart

End If
Thanks!
/Ron