473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Need Assistance adding a second series to an excel chart with VB.Net

MitchR
65 64KB
Hello all! I am in need of some guidance .... please! I am able to place a single series of chart data with my code but I cannot for the life of me figure out how to add a second series. I can add the Series ... I can Select the series but cannot with out errors figure out how to put data the the series' that I am creating ... PLEASE Help! Thank you in advance

Ol' Mitch

xlApp.ActiveChart.SeriesCollection(1).Values = Rng1 <-- Error


xlApp.ActiveChart.SeriesCollection(2).Values = Rng2 <-- Error

Expand|Select|Wrap|Line Numbers
  1.  Rng1 = xlApp.ActiveSheet.Range("B501:C511")
  2.  
  3.            Rng2 = xlApp.ActiveSheet.Range("E501:F505")
  4.  
  5.  
  6.             xlApp.ActiveSheet.ChartObjects.Add(75, 180, 815, 200).Select()
  7.             xlApp.ActiveChart.ChartStyle = 42
  8.  
  9.             xlApp.ActiveChart.SeriesCollection.NewSeries()
  10.             xlApp.ActiveChart.SeriesCollection.NewSeries()
  11.  
  12.  
  13.             xlApp.ActiveChart.SeriesCollection(1).Select()
  14.             xlApp.ActiveChart.SeriesCollection(1).Values = Rng1 <--Error 
  15.  
  16.             xlApp.ActiveChart.SeriesCollection(2).Select()
  17.             xlApp.ActiveChart.SeriesCollection(2).Values = Rng2 <-- Error
  18.  
  19.  
  20.             xlApp.ActiveChart.HasTitle = True
  21.             xlApp.ActiveChart.ChartTitle.Characters.Text = "Title"
  22.  
Jan 19 '10 #1
0 1183

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: mscir | last post by:
Date: Thu, 08 Jul 2004 17:02:27 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <10ero4l3kp2qa65@corp.supernews.com> Reply-To: mscir@usa.com User-Agent: Mozilla/5.0...
8
by: deko | last post by:
When using automation (and especially with early binding) I've heard it is best to use explicit references to everything. For example: Dim xlChart as Excel.Chart rather than Dim objChart...
1
by: ian.davies52 | last post by:
I have an msgraph on a form. The chart has five series on it. On the same form I have five checkboxes. I'm trying to make it so that checking/unchecking a checkbox will result in each of the series...
0
by: pmclinn | last post by:
The code below takes the data from the S column and grabs all the data and graphs it. The problem is this example grabs 500 cells worth of data and some of these cells = nothing. How do I rescope...
3
by: saragoesnuts | last post by:
I have a program that automates to Excel with information in tables. I want to add charts to the excel file (pie charts, bar charts, etc). Is this possible?
0
by: AlexNunley | last post by:
I am trying to dump data from an access query into excel so I can pretify it. I found sample code from an old access 97 book (The version of access in use)and tinkered it into working. Well sort...
7
by: Rnykster | last post by:
I know a little about Access and have made several single table databases. Been struggling for about a month to do a multiple table database with no success. Help! There are two tables. First...
0
by: naish | last post by:
Hi, My code drawing a graph in excel sheet. There one colum for lower pressure and another one for upper pressure. Any howi can draw a series for one pressure but i am not able to draw two series...
1
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 ...
4
by: keirnus | last post by:
Hello, I've been coding in Access VBA to create an Excel Graph and it was good. Until I got this error: Please check the code below: Private Sub TestGraph3()
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.