LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Jon Peltier's code: can't delete initial series??

I wrote this on my machine running Win XP and XL2002. It worked. I gave it
to a friend running Win2000 and XL2000, and it fails on the code to delete
the initial series. What else can we do?

Ed

Sub MakeNewScatterChart()

Dim wkb As Workbook
Dim wks As Worksheet
Dim LastRow As Long
Dim LastCol As Long
Dim colData As Long
Dim cht As Chart
Dim chtObj As ChartObject
Dim rngData As Range
Dim rngXval As Range
Dim rngSer As Range
Dim strTitle As String

' Get limits of data
Set wkb = ActiveWorkbook
Set wks = wkb.Sheets(1)
LastRow = wks.Range("A65536").End(xlUp).Row
LastCol = wks.Range("IV4").End(xlToLeft).Column

' Set data range
Set rngData = wks.Range(Cells(4, 1), Cells(LastRow, LastCol))

' Define X data range
Set rngXval = rngData.Columns(1)

For colData = 2 To LastCol
' Add new chart object
Set cht = wkb.Charts.Add
With cht
.ChartType = xlXYScatterSmoothNoMarkers

''' *** ERROR HERE ***
' Delete initial data series
Do While .SeriesCollection.Count 0
.SeriesCollection(1).Delete
Loop


 
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
2 Questions John Calder New Users to Excel 18 August 24th 06 04:17 AM
delete some cell formulas and leave others using code john tempest Excel Worksheet Functions 0 February 23rd 06 03:51 PM
Delete Code Modules Programatically blatham Excel Discussion (Misc queries) 1 February 3rd 06 05:38 PM
Code to delete rows and column cells that have formulas in. GarToms Excel Worksheet Functions 1 January 18th 06 01:04 PM
Stubborn toolbars in Excel 007 Excel Discussion (Misc queries) 9 December 11th 04 02:02 PM


All times are GMT +1. The time now is 07:44 AM.

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"