Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Works in 2007 but not 2003

The following code works in Excel 2007 but not 2003. Anyone know why? Fails
on second line - although if I hash that line out it then fails on third
line.

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(2).Name = "=""Male"""
ActiveChart.SeriesCollection(2).Values = "=WMP!$Bm$4:$Bm$64"


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Works in 2007 but not 2003

I'm thinking this should work in both

Dim aWS As Worksheet
Dim myWS As Worksheet
Set aWS = ActiveSheet
Set myWS = ThisWorkbook.Worksheets("WMP")

aWS.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(2).Name = "=""Male"""
ActiveChart.SeriesCollection(2).Values = myWS.Range("BM4:BM64")

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"teepee" wrote:

The following code works in Excel 2007 but not 2003. Anyone know why? Fails
on second line - although if I hash that line out it then fails on third
line.

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(2).Name = "=""Male"""
ActiveChart.SeriesCollection(2).Values = "=WMP!$Bm$4:$Bm$64"



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Works in 2007 but not 2003


"Barb Reinhardt" wrote in message
...
I'm thinking this should work in both

Dim aWS As Worksheet
Dim myWS As Worksheet
Set aWS = ActiveSheet
Set myWS = ThisWorkbook.Worksheets("WMP")

aWS.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(2).Name = "=""Male"""
ActiveChart.SeriesCollection(2).Values = myWS.Range("BM4:BM64")

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.


No sorry didn't work


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Works in 2007 but not 2003

Hi,

Following line works fine in xl2002 so can't think why it does not work in
xl2003.
ActiveChart.SeriesCollection(2).Name = "=""Male"""

For values line try changing range format.
ActiveChart.SeriesCollection(2).Values = "=WMP!R4C65:R64:C65"

--
Regards,

OssieMac


"teepee" wrote:

The following code works in Excel 2007 but not 2003. Anyone know why? Fails
on second line - although if I hash that line out it then fails on third
line.

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(2).Name = "=""Male"""
ActiveChart.SeriesCollection(2).Values = "=WMP!$Bm$4:$Bm$64"



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Works in 2007 but not 2003

many thanks




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Works in 2007 but not 2003


"OssieMac" wrote

ActiveChart.SeriesCollection(2).Values = "=WMP!R4C65:R64:C65"


I think you mean "=WMP!R4C65:R64C65"

For some reason it also doesn't work in 2003 but does in 2007. Weird


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Works in 2007 but not 2003

This is very weird.

I have two macros - one to hide the line by referring it to a blank column
(column 60) and one to show it by refering to the right column (column 64).
Both work in 2007 but only the former works in 2003. Mad - they're more or
less identical

Sub graphall()

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Name = "=""All"""
ActiveChart.SeriesCollection(1).Values = "=WMP!R4C64:R64C64"
Range("Aq1").Select
End Sub

Sub nographall()

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Name = "=""All"""
ActiveChart.SeriesCollection(1).Values = "=WMP!R4C60:R64C60"
Range("Aq1").Select

End Sub


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Works in 2007 but not 2003

The error, incidently, is 1004 - "unable to set the name property of the
series class"


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Works in 2007 but not 2003

Previously I did not understand that you were trying to set the series to a
null range of data. Same thing happens when I try it in xl2002.

I suggest that you repost a question "How to Hide/Unhide a series on a
chart". Post it under Excel Charts on the MS Commnunites site.

--
Regards,

OssieMac


"teepee" wrote:

This is very weird.

I have two macros - one to hide the line by referring it to a blank column
(column 60) and one to show it by refering to the right column (column 64).
Both work in 2007 but only the former works in 2003. Mad - they're more or
less identical

Sub graphall()

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Name = "=""All"""
ActiveChart.SeriesCollection(1).Values = "=WMP!R4C64:R64C64"
Range("Aq1").Select
End Sub

Sub nographall()

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Name = "=""All"""
ActiveChart.SeriesCollection(1).Values = "=WMP!R4C60:R64C60"
Range("Aq1").Select

End Sub



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Works in 2007 but not 2003


"OssieMac" wrote

Previously I did not understand that you were trying to set the series to
a
null range of data. Same thing happens when I try it in xl2002.


Ah it's the null data that's the problem. Of course. Thanks.

I'll just set the column to zeroes and repaint the graph line the same as
background colour. Thanks for your help.




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
xls file works fine in Excel 2000 and 2007 but crashes on opening in 2003 gromit12 Excel Discussion (Misc queries) 2 November 6th 07 09:30 PM
Works 7.0 database files to Excel 2007 Jane Excel Discussion (Misc queries) 1 October 29th 07 02:07 PM
How do you import from Office 2007 into MS Works? Jim in Tx Excel Discussion (Misc queries) 1 April 23rd 07 07:47 AM
How to inport works spreadsheet into excel 2007 Miro Excel Worksheet Functions 1 May 28th 06 05:55 PM
Works 4.0(wks) needs to be converted to Excel 2003 BJB Excel Discussion (Misc queries) 2 July 15th 05 03:49 PM


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