View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Print a Chart worksheet

Check to make sure the Chart Sheet Tab on the bottom of the sheet matches the
code. Excel renames charts after the Adds statement.

A chart has one name when its created with the ADD and then changes names
when the location statment is executed. I've seen this happen with excel
2003.

"miek" wrote:

I have the following code that falls on it face.
The chart gets built like:

Charts.Add
ActiveChart.ChartType = xlColumnClustered
....
ActiveChart.Location Whe=xlLocationAsNewSheet, Name:="MyChart"

When I try to print with the below code I recieve a Run-time error 1004
"unable to get the chartobject propertyof the ws class" on the .Activate line

ActiveSheet.ChartObjects("MyChart").Activate
ActiveSheet.PrintOut

Thanks for your help