Excel 03 to Excel 07

M

Markus

I am moving from Excel 03 to Excel 07 in Office 07. I have code that
automates the creation of excel charts, and one line is coughing up an error.

This line is where I am selecting a seriescollection to set datalabels.
e.g., ActiveChart.SeriesCollection(1).DataLabels.Select()
The error indicates the object is not defined.

This is code that has run for years in the older version of Excel, so I have
to think the syntax for setting labels must have changed.

Anyone know of a solution, and anyone know of reference that can help me
make this transition, i.e., somewhere that documents VBA syntax changes?

Many thanks for any ideas on this,
Mark
 
J

Jacob Skaria

Try

Activesheet.chartobjects(1).select
'OR
'Activesheet.chartobjects("<charname>').select
If ActiveChart.SeriesCollection(1).HasDataLabels = True Then
ActiveChart.SeriesCollection(1).DataLabels.Select
End If

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top