Using a name in a graph series formula

miktek
04-09-2001, 10:03 AM
Running into brick wall with using a name in a series formula. this comes right out of p487 of the Walkenbach book "Excel 2000 programming with VBA" just in case anyone's seen that.

Book says"references on series formulas are always absolute." Then later on p 492, it describes how to use names in series formulas. This is the crux of everything I want to do in that I am collecting periodic data and then want to update the chart by using vba to change the range reference in the series formula.

I get the compile error "invalid char" for the $ everytime. Heres my snippet of code:

Dim MySeries1 As Series
myseries1.Formula = SERIES(Sheet4!$B$3:$B$20,1))

Can't for the life of me figure out whats wrong. Taking it right out of the book.
Thanks for any help.

-YX-
06-30-2003, 02:13 PM
Ya well ear that my friend... I used the macro recorder to get some working source code... but Excel can not produce a working code of it (changing the seriesCollection ranges) ... like it can not write VB that do just that and I can not replay the macro recorded... it will make error... and you know what???? I was able to make one work... it works for one graph in my workbook but not for the second???? I am a experience programmer and I can tell you that this stuff is really bug from the root (Microsoft)...

YX

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum