Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
Thank you very much Ed! I will try out what you mean as well.
-- mfg2529 "Ed Ferrero" wrote: Hi, There is a difference in VBA between a Chart and a ChartObject. The latter is a sort of container for a Chart and can be embedded in a Worksheet. ActiveChart is a property of the ChartObject and is read-only. You can't write something like Set ActiveChart = MyObject. To use the Chart name instead of the index, find out what the chart name is (Ctrl-Click on the embedded chart and read the name of the Chart Object at the top left). Then enclose it in double-quotes in your code. Usually something like ..ChartObjects("Chart 1") not .ChartObjects(Chart1) Try running this bit of code to understand what is going on; Option Explicit ' good idea to always put this before any of your code Sub tst() Dim cht As Chart Dim oCht As ChartObject Set oCht = ActiveSheet.ChartObjects("Chart 1") Set cht = ActiveSheet.ChartObjects("Chart 1").Chart Debug.Print oCht.Name, cht.Name ' you can activate the ChartObject , you can't activate the chart oCht.Activate End Sub Ed Ferrero www.edferrero.com . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I save a 40meg 26,000 row file to Space Delimited format | Excel Discussion (Misc queries) | |||
How can I save an excel 2007 chart in a vector graphics format? | Charts and Charting in Excel | |||
Lost columns in formated text (space delimited) save | Excel Worksheet Functions | |||
How can I save an excel chart in gif format? | Charts and Charting in Excel | |||
Excel save as htm with functionality too much white space | Excel Discussion (Misc queries) |