473,583 Members | 4,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Excel Chart SeriesCollectio n Error

Hi all. I am having a bit of a problem with my Perl script and the
creation of a chart. I can create the chart and create a new
SeriesCollectio n. I then specify the XValues and the Values parameter
of the first SeriesCollectio n object. I add another SeriesCollectio n,
but I am only able to set the XValues and I get the following error
when I try to set the Values parameter:

OLE exception from "Microsoft Office Excel":

Unable to set the Values property of the Series class

Win32::OLE(0.17 01) error 0x80020009: "Exception occurred"
in PROPERTYPUT "Values" at winprocgraph.pl line 101

Here is the snippet of code that is causing me this headache:

#$chart - chart object
#$xls - workbook object
#$worksheet - worksheet object

$chart = $xls->Charts->Add();
$chart->SetSourceData( {Source=>$works heet->Range("A1")} );
$chart->{ChartType} = xlXYScatter;

$chart->SeriesCollecti on->NewSeries();
$chart->SeriesCollecti on->NewSeries();
#this series gets added correctly
$chart->SeriesCollecti on(1)->{XValues} = "='LOGIC'!R2C1: R231C1";
$chart->SeriesCollecti on(1)->{Values} = "='LOGIC'!R2C2: R231C2";
#only the XValues is added correctly here
$chart->SeriesCollecti on(2)->{XValues} = "='LOGIC'!R2C3: R231C3";
$chart->SeriesCollecti on(2)->{Values} = "='LOGIC'!R2C4: R231C4";

$chart->Location({Wher e=>xlLocationAs Object, Name=>"GRAPH"}) ;

Any help would be greatly appreciated. I have been searching online
for examples to try and see what I am doing wrong, and so far it looks
correct to me. Thanks in advance.

Brian
Jul 19 '05 #1
1 12503
shamus
1 New Member
Hi all. I am having a bit of a problem with my Perl script and the
creation of a chart. I can create the chart and create a new
SeriesCollectio n. I then specify the XValues and the Values parameter
of the first SeriesCollectio n object. I add another SeriesCollectio n,
but I am only able to set the XValues and I get the following error
when I try to set the Values parameter:

OLE exception from "Microsoft Office Excel":

Unable to set the Values property of the Series class

Win32::OLE(0.17 01) error 0x80020009: "Exception occurred"
in PROPERTYPUT "Values" at winprocgraph.pl line 101

Here is the snippet of code that is causing me this headache:

#$chart - chart object
#$xls - workbook object
#$worksheet - worksheet object

$chart = $xls->Charts->Add();
$chart->SetSourceData( {Source=>$works heet->Range("A1")} );
$chart->{ChartType} = xlXYScatter;

$chart->SeriesCollecti on->NewSeries();
$chart->SeriesCollecti on->NewSeries();
#this series gets added correctly
$chart->SeriesCollecti on(1)->{XValues} = "='LOGIC'!R2C1: R231C1";
$chart->SeriesCollecti on(1)->{Values} = "='LOGIC'!R2C2: R231C2";
#only the XValues is added correctly here
$chart->SeriesCollecti on(2)->{XValues} = "='LOGIC'!R2C3: R231C3";
$chart->SeriesCollecti on(2)->{Values} = "='LOGIC'!R2C4: R231C4";

$chart->Location({Wher e=>xlLocationAs Object, Name=>"GRAPH"}) ;

Any help would be greatly appreciated. I have been searching online
for examples to try and see what I am doing wrong, and so far it looks
correct to me. Thanks in advance.

Brian
Hi Brian, If you ever received a reply or found an answer to your question I would be pleased to hear about it. cheers. shamus
Jul 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
19614
by: Kevin Long | last post by:
Hi everybody. I was wondering if somebody out there could tell me what is wrong with this code? I'm trying to plot a chart in excel using VB. For this example, the value of the Index variable is 150, but it could be anything because it is calculated earlier in the code. I can't see anything wrong with the code myself, but it seems not to...
22
6761
by: PeteCresswell | last post by:
I've been to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjtitleobject.asp, but still don't have a clue. For example, I've got a chart object namde 'grphStats' in a form named frmChart. ?Forms!frmChart!grphStats.Name returns "grphStats" as expected, but I can't get any further.
1
2560
by: Randall Arnold | last post by:
I'm converting a vbscript program to vb.net. Witht he exception of .net idiosyncrasies, most of it is working well with the same code. My only problem is that some properties and methods are missing from the Chart object. For instance, the following line worked fine in vbscript (csPowerSpeed is the chart): ...
0
19571
by: JonathanParker | last post by:
Hello, Wondered if you could help me with a little issue I'm having. I'm exporting some data from Access to Excel and converting into some fancy graphs. The number of series' ranges from 2 to 5. Below isa copy of the code I am using to format the graph in terms of series names, layout, colours of lines, etc. When the full 5 series are there...
0
3643
by: c0dergirl | last post by:
This c# program allows you to select multiple items from a listbox. For each selected item, a worksheet is created in the workbook with some information. Right now I create a chart that plots some information from one of the sheets. What I want to do is have a line on the graph for every sheet. I assume I use multiple datasources to do this,...
0
2509
by: madhatter84gn | last post by:
I am trying to automate an excel spreadsheet and then create a chart. Dim chartRange As Excel.Range If rollup Then chartRange = sheet.Range("O2:Q14", Type.Missing) chartRange.Select() Else chartRange = sheet.Range("N:N,M:M,A:A", Type.Missing) ...
1
1807
by: shlaga | last post by:
Hi, I have query in access that i output in excel and want to graph the output. I have written the code for this in access -> visual basic i want the code to get the range of the xvalues and the yvalues from the output query in excel sheet and graph column B vs Column A... For the graphing part of the code this is what i have:
1
2009
by: supermanii | last post by:
Hi everybody, I have a problem in vb6 code. I would like to make a chart on excel file with vb and I can make it with this code. With oChart .SeriesCollection.NewSeries .ChartType = xlColumnStacked .SeriesCollection(1).XValues = oSheet.Range("A1").Resize(1, 10) .SeriesCollection(1).Values =...
1
3743
by: oleval | last post by:
Hi All, I need a VBA MS Excel code to duplicate a series in the chart, which has just one series. Effectively, as a result the chart should have two identical serieses. Thank you for your help! PS. I tried this code, but it ends up with run-time error... ActiveChart.ChartArea.Select ' the chart has one series...
0
7894
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8179
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7933
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8191
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5700
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1431
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1155
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.