LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Chart SeriesCollection. Problem changing from Excel 2000 to 2002


I'm using perl and Win32::OLE but I'm wondering if there
are any known issues before I delve more into a perl solution.

The problem is as follows:

I have a data sheet with 5 columns of data called "$Sheet".
In Excel 2000 each of the columns ends up in a separate series
when creating a chart with the 5 columns in the datarange.

When switching from Excel 2000 to Excel 2002 the chart creation
takes the 5 column range and sets the first 4 columns as the
first series. So I only get 2 series :-(

Does anyone have any idea how to work around this
or why it's happening?
Any pointers to relevant documentation somwhere?
Or any other suggestions?


A small snip of the relevant code for context follows.
(Anyone used to VB probably understand it)

# My datarange
my $Range = $Sheet-Range('B2:F38');

# Create a new chart
my $num_of_Sheets = $Book-Worksheets-{Count};
my $chart = $Book-Charts-Add({After = $Book-Worksheets($num_of_Sheets)})
|| die Win32::OLE-LastError();

# Name the chart
$chart-{Name} = $Cdays[$dow-1];

$chart-SetSourceData({Source = $Range,
PlotBy = xlColumns
});

# Put Chart on a page of its own
$chart-Location({Where = xlLocationAsNewSheet });

$chart-SeriesCollection(1)-{AxisGroup} = xlPrimary;
$chart-SeriesCollection(1)-{ChartType} = xlColumnStacked;
$chart-SeriesCollection(1)-Fill-TwoColorGradient(1,1);
$chart-SeriesCollection(1)-Fill-ForeColor-{SchemeColor} = 10;
$chart-SeriesCollection(1)-Fill-BackColor-{SchemeColor} = 1;

$chart-SeriesCollection(2)-{AxisGroup} = xlPrimary;
$chart-SeriesCollection(2)-{ChartType} = xlColumnStacked;
$chart-SeriesCollection(2)-Fill-TwoColorGradient(1,1);
$chart-SeriesCollection(2)-Fill-ForeColor-{SchemeColor} = 3;
$chart-SeriesCollection(2)-Fill-BackColor-{SchemeColor} = 1;

# Crashes on the following line with
# Can't use an undefined value as a HASH reference at ..... file name and linenr
$chart-SeriesCollection(3)-{AxisGroup} = xlSecondary;
$chart-SeriesCollection(3)-{ChartType} = xlLineMarkers;
$chart-SeriesCollection(3)-{MarkerBackgroundColorIndex} = 7;
$chart-SeriesCollection(3)-{MarkerForegroundColorIndex} = 7;
$chart-SeriesCollection(3)-{MarkerStyle} = xlTriangle;
$chart-SeriesCollection(3)-Border-{Colorindex} = 7;
$chart-SeriesCollection(3)-Border-{Weight} = xlMedium;

SNIP REST..
 
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
Excel Chart SeriesCollection Formula sgpl Excel Discussion (Misc queries) 1 February 19th 09 05:21 PM
PROBLEM:How to squeeze 2 Page sized Chart in Excel 2000 & embed in Word 2000 and print from Word to fit one page ??? [email protected] Excel Discussion (Misc queries) 2 September 10th 08 11:07 AM
PROBLEM:How to squeeze 2 Page sized Chart in Excel 2000 & embed in Word 2000 and print from Word to fit one page ??? [email protected] New Users to Excel 2 September 10th 08 11:07 AM
Excel 2000 to Excel 2002 problem Dave the slaphead Excel Discussion (Misc queries) 3 February 17th 05 06:17 PM
Setting SeriesCollection values in Excel 2000 nubee Excel Programming 4 May 29th 04 03:08 AM


All times are GMT +1. The time now is 11:49 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"