Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA and charts
Hi all. I'm having trouble working with charts in Excel using Visual basic.
What I'm trying to do is take an embedded chart that is selected, copy and paste it, then select the original chart. The trouble I'm having is that I just can't get visual basic to tell me the index of the active chart! Msgbox ActiveChart.Index returns an "Method 'Index' of object '_Chart' failed" error Msgbox ActiveChart.name works, but returns "charts Chart 12" for example. This would be fine if I could then use this to refer to the chart later, but I think the extra "charts" is throwing it off Can anyone offer any help Eric |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA and charts
This gives the number for the chartObject --
Sub GetIndex() Dim chObj As ChartObject Set chObj = ActiveChart.Parent Debug.Print ActiveSheet _ .ChartObjects(chObj.Name).Index End Sub Eric wrote: Hi all. I'm having trouble working with charts in Excel using Visual basic. What I'm trying to do is take an embedded chart that is selected, copy and paste it, then select the original chart. The trouble I'm having is that I just can't get visual basic to tell me the index of the active chart! Msgbox ActiveChart.Index returns an "Method 'Index' of object '_Chart' failed" error. Msgbox ActiveChart.name works, but returns "charts Chart 12" for example. This would be fine if I could then use this to refer to the chart later, but I think the extra "charts" is throwing it off. Can anyone offer any help? Eric -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
charts toolbar / charts disappeared | Charts and Charting in Excel | |||
link excel charts to web pages and update charts automatically | Charts and Charting in Excel | |||
Charts - How to have multiple charts share a legend. | Charts and Charting in Excel | |||
interactive charts for stacked bar charts | Charts and Charting in Excel | |||
Matching the colors Column Charts and Pie Charts | Charts and Charting in Excel |