Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with creating chart within existing worksheet.


Hi all,

Essentially I have an existing worksheet with data and would like t
create charts from that data and place the charts on this sheet. Whe
attempting to run my code, I get an "Automation Error". Here is a
excerpt of my code that is currently problematic:

If Location1_1 0 Then
Set case9 = wb.Charts.Add
With case9
.ChartType = xlXYScatterSmooth
.Location Whe=xlLocationAsObject, Name:="DataSet 1"

.SeriesCollection.NewSeries
Set Cycles = SetRange(page1, 3, 62, 8)
.SeriesCollection(1).Xvalues = Cycles
.SeriesCollection(2).Xvalues = Cycles

Set YValues = SetRange(page1, 3, 62, 9)
.SeriesCollection(1).Name = "V1"
.SeriesCollection(1).Values = YValues

.SeriesCollection.NewSeries
.SeriesCollection(2).Name = "I1"
Set YValues = SetRange(page1, 3, 62, 10)
.SeriesCollection(2).Values = YValues
.SeriesCollection(2).AxisGroup = 2

<formatting statements

End With
End If
End Sub


The compiler highlights the line ".SeriesCollection.NewSeries" as th
source of the error.

Any help would be greatly appreciated.

Thanks

--
3PhaseMacroMa
-----------------------------------------------------------------------
3PhaseMacroMan's Profile: http://www.excelforum.com/member.php...fo&userid=2994
View this thread: http://www.excelforum.com/showthread.php?threadid=49700

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with creating chart within existing worksheet.


Hello 3PhaseMacroMan,

Unless your system is different, SeriesCollection is a method that
requires an index arugument...

EXAMPLE 1:
..SeriesCollection(1)

This returns a single series. To return all the seiries in a chart
use...

EXAMPLE 2:
..SeriesCollection

If NewSeries is a numeric index then use example 1.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=497003

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
Creating pivot table to Existing worksheet Malvaro Excel Worksheet Functions 1 August 29th 08 02:32 PM
Copying a chart and data to existing worksheet Amy Ilene[_2_] Charts and Charting in Excel 5 April 2nd 07 02:22 AM
Excel 2007 chart problem with existing spreadsheet Mark Excel Discussion (Misc queries) 3 June 19th 06 12:51 PM
How To: Link worksheet data to pre-existing chart tables Fitz Excel Discussion (Misc queries) 4 October 24th 05 11:05 PM
Creating new worksheet from existing ddpen Excel Discussion (Misc queries) 2 December 1st 04 10:35 PM


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