Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
mb mb is offline
external usenet poster
 
Posts: 4
Default charting independent XYScatter graphs

I'm trying to create a XYScatter graph of 3 independent datasets from
within VB6 using OLE/Excel2000.

I'm using the KB147803 article as a basis, but am stuck and hope someone
can help.

The example in KB147803 seems to indicate that there can only be one set
of X-Values for the 3 XY Scatter Graph data sets.

The X-Value series is the first row of data in the sheet, and is called
out as a set of Category labels ('cwCategoryLabels=1'), and applies to
all three subsequent rows of Y-Value data.

In my case, I want to plot 3 independent sets of XY data, so I'd like to
provide a separate row of X-Value data for each row of Y-Value data.

I'm not seeing how I can pass this sort of a dataset to
objChartChartWizard...is there a way?


Thanks very much for any help!

Michael

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default charting independent XYScatter graphs

Michael -

Visit this page:

http://peltiertech.com/Excel/ChartsH...kChartVBA.html

Pay attention to the sections on adding series:

Sub AddNewSeries()
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With
End Sub
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"mb" wrote in message
...
I'm trying to create a XYScatter graph of 3 independent datasets from
within VB6 using OLE/Excel2000.

I'm using the KB147803 article as a basis, but am stuck and hope someone
can help.

The example in KB147803 seems to indicate that there can only be one set
of X-Values for the 3 XY Scatter Graph data sets.

The X-Value series is the first row of data in the sheet, and is called
out as a set of Category labels ('cwCategoryLabels=1'), and applies to
all three subsequent rows of Y-Value data.

In my case, I want to plot 3 independent sets of XY data, so I'd like to
provide a separate row of X-Value data for each row of Y-Value data.

I'm not seeing how I can pass this sort of a dataset to
objChartChartWizard...is there a way?


Thanks very much for any help!

Michael



  #3   Report Post  
Posted to microsoft.public.excel.charting
mb mb is offline
external usenet poster
 
Posts: 4
Default charting independent XYScatter graphs

Jon,

Thanks for the quick reply!

The example code you posted appears to be VBA: do you know if you can do
the same thing from within a Visual Basic 6 application?

I'm currently using Excel 2000 and can update it if necessary, but I"m
pretty stuck with VB6. Buying a VB6 add-on to enable this would be a viable
alternative.

thanks again,

Michael


In article ,
says...


Michael -

Visit this page:

http://peltiertech.com/Excel/ChartsH...kChartVBA.html

Pay attention to the sections on adding series:

Sub AddNewSeries()
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With
End Sub
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"mb" wrote in message
.. .
I'm trying to create a XYScatter graph of 3 independent datasets from
within VB6 using OLE/Excel2000.

I'm using the KB147803 article as a basis, but am stuck and hope someone
can help.

The example in KB147803 seems to indicate that there can only be one set
of X-Values for the 3 XY Scatter Graph data sets.

The X-Value series is the first row of data in the sheet, and is called
out as a set of Category labels ('cwCategoryLabels=1'), and applies to
all three subsequent rows of Y-Value data.

In my case, I want to plot 3 independent sets of XY data, so I'd like to
provide a separate row of X-Value data for each row of Y-Value data.

I'm not seeing how I can pass this sort of a dataset to
objChartChartWizard...is there a way?


Thanks very much for any help!

Michael




  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default charting independent XYScatter graphs

The code is nearly the same. The difference is that you have to qualify the
code in VB6 a bit more formally.

For instance, you need a variable pointing to the working instance of Excel.
Supposing the variable is xlApp, then the code I posted looks like this:

With xlApp.ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______



"mb" wrote in message
...
Jon,

Thanks for the quick reply!

The example code you posted appears to be VBA: do you know if you can do
the same thing from within a Visual Basic 6 application?

I'm currently using Excel 2000 and can update it if necessary, but I"m
pretty stuck with VB6. Buying a VB6 add-on to enable this would be a
viable
alternative.

thanks again,

Michael


In article ,
says...


Michael -

Visit this page:

http://peltiertech.com/Excel/ChartsH...kChartVBA.html

Pay attention to the sections on adding series:

Sub AddNewSeries()
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With
End Sub
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"mb" wrote in message
. ..
I'm trying to create a XYScatter graph of 3 independent datasets from
within VB6 using OLE/Excel2000.

I'm using the KB147803 article as a basis, but am stuck and hope someone
can help.

The example in KB147803 seems to indicate that there can only be one set
of X-Values for the 3 XY Scatter Graph data sets.

The X-Value series is the first row of data in the sheet, and is called
out as a set of Category labels ('cwCategoryLabels=1'), and applies to
all three subsequent rows of Y-Value data.

In my case, I want to plot 3 independent sets of XY data, so I'd like to
provide a separate row of X-Value data for each row of Y-Value data.

I'm not seeing how I can pass this sort of a dataset to
objChartChartWizard...is there a way?


Thanks very much for any help!

Michael






  #5   Report Post  
Posted to microsoft.public.excel.charting
mb mb is offline
external usenet poster
 
Posts: 4
Default charting independent XYScatter graphs

Here's a snippet of my code:

OLE1.CreateEmbed "", "Excel.Chart.5"
Set objChart = OLE1.object.ActiveChart
Set objSheet = objChart.Parent.Worksheets(1)
Set objXL = objChart.Application

I tried substituting both "OLE1.object.Application" and "objXL" for xlApp in
your example:

With objXL.ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With

But I get the error: <Object variable or With block variable not set

A watch on objXL shows it equal to "Microsoft Excel", but the ".ActiveChart"
provokes the error.

Any thoughts?

thanks,

Michael



In article ,
says...


The code is nearly the same. The difference is that you have to qualify the
code in VB6 a bit more formally.

For instance, you need a variable pointing to the working instance of Excel.
Supposing the variable is xlApp, then the code I posted looks like this:

With xlApp.ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -
http://PeltierTech.com
_______



"mb" wrote in message
.. .
Jon,

Thanks for the quick reply!

The example code you posted appears to be VBA: do you know if you can do
the same thing from within a Visual Basic 6 application?

I'm currently using Excel 2000 and can update it if necessary, but I"m
pretty stuck with VB6. Buying a VB6 add-on to enable this would be a
viable
alternative.

thanks again,

Michael


In article ,
says...


Michael -

Visit this page:

http://peltiertech.com/Excel/ChartsH...kChartVBA.html

Pay attention to the sections on adding series:

Sub AddNewSeries()
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With
End Sub
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"mb" wrote in message
.. .
I'm trying to create a XYScatter graph of 3 independent datasets from
within VB6 using OLE/Excel2000.

I'm using the KB147803 article as a basis, but am stuck and hope someone
can help.

The example in KB147803 seems to indicate that there can only be one set
of X-Values for the 3 XY Scatter Graph data sets.

The X-Value series is the first row of data in the sheet, and is called
out as a set of Category labels ('cwCategoryLabels=1'), and applies to
all three subsequent rows of Y-Value data.

In my case, I want to plot 3 independent sets of XY data, so I'd like to
provide a separate row of X-Value data for each row of Y-Value data.

I'm not seeing how I can pass this sort of a dataset to
objChartChartWizard...is there a way?


Thanks very much for any help!

Michael









  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default charting independent XYScatter graphs

If your objChart is reliably defined, then:

With objChart.SeriesCollection.NewSeries

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"mb" wrote in message
...
Here's a snippet of my code:

OLE1.CreateEmbed "", "Excel.Chart.5"
Set objChart = OLE1.object.ActiveChart
Set objSheet = objChart.Parent.Worksheets(1)
Set objXL = objChart.Application

I tried substituting both "OLE1.object.Application" and "objXL" for xlApp
in
your example:

With objXL.ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With

But I get the error: <Object variable or With block variable not set

A watch on objXL shows it equal to "Microsoft Excel", but the
".ActiveChart"
provokes the error.

Any thoughts?

thanks,

Michael



In article ,
says...


The code is nearly the same. The difference is that you have to qualify
the
code in VB6 a bit more formally.

For instance, you need a variable pointing to the working instance of
Excel.
Supposing the variable is xlApp, then the code I posted looks like this:

With xlApp.ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -
http://PeltierTech.com
_______



"mb" wrote in message
. ..
Jon,

Thanks for the quick reply!

The example code you posted appears to be VBA: do you know if you can do
the same thing from within a Visual Basic 6 application?

I'm currently using Excel 2000 and can update it if necessary, but I"m
pretty stuck with VB6. Buying a VB6 add-on to enable this would be a
viable
alternative.

thanks again,

Michael


In article ,
says...


Michael -

Visit this page:

http://peltiertech.com/Excel/ChartsH...kChartVBA.html

Pay attention to the sections on adding series:

Sub AddNewSeries()
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("G3")
.Values = ActiveSheet.Range("G4:G14")
.XValues = ActiveSheet.Range("A4:A14")
End With
End Sub
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"mb" wrote in message
. ..
I'm trying to create a XYScatter graph of 3 independent datasets from
within VB6 using OLE/Excel2000.

I'm using the KB147803 article as a basis, but am stuck and hope
someone
can help.

The example in KB147803 seems to indicate that there can only be one
set
of X-Values for the 3 XY Scatter Graph data sets.

The X-Value series is the first row of data in the sheet, and is
called
out as a set of Category labels ('cwCategoryLabels=1'), and applies to
all three subsequent rows of Y-Value data.

In my case, I want to plot 3 independent sets of XY data, so I'd like
to
provide a separate row of X-Value data for each row of Y-Value data.

I'm not seeing how I can pass this sort of a dataset to
objChartChartWizard...is there a way?


Thanks very much for any help!

Michael









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
Independent Lists... Corey New Users to Excel 2 July 10th 06 07:17 PM
how to look up values with two independent variables charlesfung Excel Worksheet Functions 4 June 17th 06 03:32 PM
Help with datapoints stack in XYScatter PO Charts and Charting in Excel 1 May 14th 06 11:43 PM
Charting 3-D Graphs with Empty Cells [email protected] Charts and Charting in Excel 2 January 21st 06 02:11 PM
Custom charting - Stacked charting with a line Randy Lefferts Charts and Charting in Excel 3 March 3rd 05 03:10 AM


All times are GMT +1. The time now is 09:51 PM.

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

About Us

"It's about Microsoft Excel"