Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Print a Chart worksheet

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Print a Chart worksheet

I right clicked on the WS tab and copied the tab name and placed this value
in the:
ActiveSheet.ChartObjects("MyChart").Activate code line

"Joel" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Print a Chart worksheet

Did it Work?

The statement
ActiveSheet.ChartObjects("MyChart").Activate

Is not needed to print the chart. You are printing a sheet
(ActiveSheet.PrintOut) not the object on the sheet. To find the name of the
Chart Object Manually Activate the chart with the mouse and look at the box
left of the f(x).

"Joel" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Print a Chart worksheet

No, I get the same results

"Joel" wrote:

Did it Work?

The statement
ActiveSheet.ChartObjects("MyChart").Activate

Is not needed to print the chart. You are printing a sheet
(ActiveSheet.PrintOut) not the object on the sheet. To find the name of the
Chart Object Manually Activate the chart with the mouse and look at the box
left of the f(x).

"Joel" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Print a Chart worksheet

I've also tried:
Worksheets("MyChart").ChartObjects.Activate
I get "run-time error 9, subscript out of range"

"Joel" wrote:

Did it Work?

The statement
ActiveSheet.ChartObjects("MyChart").Activate

Is not needed to print the chart. You are printing a sheet
(ActiveSheet.PrintOut) not the object on the sheet. To find the name of the
Chart Object Manually Activate the chart with the mouse and look at the box
left of the f(x).

"Joel" wrote:

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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Print a Chart worksheet

I did some testing. when yo place a Chart on a New Sheet there is no
Chartobject. Remove the line! You only get chart objects when a chart is
placed on a worksheet, not on a sheet by itself.

"miek" wrote:

I've also tried:
Worksheets("MyChart").ChartObjects.Activate
I get "run-time error 9, subscript out of range"

"Joel" wrote:

Did it Work?

The statement
ActiveSheet.ChartObjects("MyChart").Activate

Is not needed to print the chart. You are printing a sheet
(ActiveSheet.PrintOut) not the object on the sheet. To find the name of the
Chart Object Manually Activate the chart with the mouse and look at the box
left of the f(x).

"Joel" wrote:

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

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Print a Chart worksheet

If I have the code line:
Worksheets("A1 sum Chart").Activate
I get: "run-time error 9, subscript out of range"


"Joel" wrote:

I did some testing. when yo place a Chart on a New Sheet there is no
Chartobject. Remove the line! You only get chart objects when a chart is
placed on a worksheet, not on a sheet by itself.

"miek" wrote:

I've also tried:
Worksheets("MyChart").ChartObjects.Activate
I get "run-time error 9, subscript out of range"

"Joel" wrote:

Did it Work?

The statement
ActiveSheet.ChartObjects("MyChart").Activate

Is not needed to print the chart. You are printing a sheet
(ActiveSheet.PrintOut) not the object on the sheet. To find the name of the
Chart Object Manually Activate the chart with the mouse and look at the box
left of the f(x).

"Joel" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart doesn't print w/worksheet but will print by itself Vera Charts and Charting in Excel 2 November 7th 08 06:19 PM
Chart doesn't print w/worksheet properly but will print by itself Vera Excel Discussion (Misc queries) 2 November 7th 08 05:49 PM
Print a chart with worksheet data in excel 2007 DAVEYB Excel Discussion (Misc queries) 1 September 2nd 08 04:50 PM
How can I print a chart worksheet on legal size paper? David Vestal Charts and Charting in Excel 0 August 14th 08 04:31 PM
Print Chart Worksheet Blue Excel Programming 1 February 1st 05 02:40 AM


All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"