Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 23rd, 2004, 05:02 PM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transfer of values from an object to an XY chart

VB6 EXCEL2000

I am trying to automate plotting an XY curve from data contained in an object. Basically there appears to be no way of transfering the contents of an object into chart's x and y values (.XValues & .Values respectively). Edited code below.

Source data from array dFrequency is placed in a collection (for good reasons!). dFrequency may have up to 1600 elements, read in from a file.

Public FreqTable As New Collection
.
.
For n = 1 To nNoDataPoints
Set FreqPoint = New clsInsertFreq
FreqPoint.Freq = dFrequency(n)
FreqTable.Add FreqPoint
Next


Then the chart X&Y values is set up as follows (template already exists):

' Find the chart
Set chtObject = Worksheets("S11 dB").ChartObjects("Chart 1")

' Find the series
Set Cht = chtObject.Chart
Set scSeries = Cht.SeriesCollection

' Enter values into a new series
With scSeries.NewSeries
.Name = "Input Return Loss"
.Values =
.XValues = ???

End With

??? = all the .Freq values in FreqPoint into the XValues (never mind Y values for now) so that a graph can be generated, eg .XValues = FreqPoint.Item(n).Freq for n = 1 to nNoDataPoints would be nice.
As .XValues need variant arrays or cells there is clearly a type mismatch issue.

On one hand it looks as if I am doing something illegal, on the other surely the point of a chart to accept data...

Thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
transfer values between webforms Sheraz Khan ASP.NET 2.0 Basics 3 July 26th, 2007 06:42 AM
scatter XY chart using Script madganesh VBScript 0 June 13th, 2007 05:05 AM
chart object as anchor for hyperlink kritimehrotra Excel VBA 3 July 28th, 2006 06:01 PM
Transfer of Form Values in Javascript pkdev Javascript How-To 3 June 21st, 2004 05:15 AM
Chart X values > 1 fordrs3 Excel VBA 1 July 3rd, 2003 11:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.