Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ChartObjects
Hiya
I wish to populate a listbox with all the chartobjects within a workbook. I am using something like the following Dim xlChart as ChartObject For each XlChart in Thisworkbook.Worksheets.ChartObjects Me.ListBox.AddItem xlChart.Name Next xlChart Unfortunately it doesn't recognise the ChartObjects collection. Can any see a solution? Thanks in a advance for any help Nick Shinkins |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ChartObjects
Hi,
try something like following Sub charts_names() Dim i As Integer Dim xlChart As ChartObject For i = 1 To ActiveWorkbook.Worksheets.Count For Each xlChart In Worksheets(i).ChartObjects MsgBox xlChart.Name Next xlChart Next i End Sub Jare -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ChartObjects
I think that ChartObjects only applies to embedded charts i.e. those
whose location is a worksheet and not those that are seperate chartsheets. You probably need to check for the existence of charts under both possibilities . '+++++++++++++++++++++++++++++++++++++++++++++++++ +++++ Dim ws As Worksheet, ch As Chart, chOBJ As ChartObject ' get the names of all the chartsheets For Each ch In ActiveWorkbook.Charts Me.ListBox.AddItem ch.Name Next ch ' get the names of all the embedded For Each ws In ActiveWorkbook.Worksheets For Each chOBJ In ws.ChartObjects Me.ListBox.AddItem chOBJ.Chart.Name Next chOBJ Next ws '+++++++++++++++++++++++++++++++++++++++++++++++++ +++++ ---- Sean "Just press the off switch, and go to sleep!" *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to export all chartobjects in a sheet to powerpoint (creating a new ppt file) as pictures? | Charts and Charting in Excel | |||
Not allow selection of chartobjects ? | Charts and Charting in Excel | |||
Marcowarnings when pasting chartobjects to powerpoint | Charts and Charting in Excel | |||
Change datalabel font size for all chartobjects in a row | Charts and Charting in Excel | |||
Workbook-Events donīt work with ChartObjects | Excel Programming |