Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Setting Axis scale

0 views
Skip to first unread message

Robin Clay

unread,
Jul 25, 2003, 6:40:24 AM7/25/03
to
Greetings !

When I address a different data file, I have code to
generate a chart to display the new data.

For some s t r a n g e reason, the code SOMETIMES comes
to a grinding halt at this line -

.SeriesCollection(4).XValues = _
"=Ali2!R" & VTPStartRow & _
"C2:R" & VTPEndRow & "C2"

VTPStartRow has a value of say 80, and VTPEndRow about
100, and it works just FINE if I enter them "manually".

It never stops anywhere else, always at this line ! But
sometimes it works OK....

Jon Peltier

unread,
Jul 25, 2003, 8:32:34 PM7/25/03
to
Robin -

Before you get to this line, is the series formula valid? If the series
has no plottable data (all blanks or error values, for instance), you
will not be able to access or edit the series formula or its constituent
parts (like the XValues).

Rumor has it, and I have not extensively tried this workaround, that
changing the series to an area type will enable you to access the series
formula in such a case. Then when the series is appropriately
populated, you can revert to your original chart type.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Robin CLay

unread,
Jul 29, 2003, 8:46:18 AM7/29/03
to

>-----Original Message-----
---[ from Jon Peltier, 7/25/2003 5:32:34 PM ]-------

... for which, many thanks.

> Before you get to this line, is the series formula
> valid?

Oh, absolutely ! It starts off with a previous (working)
value, then calculates a new one, and then tries
to "insert" it into the Chart.

It grinds to a halt, and the values are there in
the "Locals" window, and I can then use these to insert
the figures manually, whereupon it works OK.

However.... it frequently just keels over at that point !
The Chart appears with a hatched box round it, and then
Bingo ! Excel crashes....

But it is ALWAYS at that particular line ! It works FINE
for the other Series...

> Rumor has it, .... that

> changing the series to an area type will enable you to
> access the series formula in such a case.
> Then when the series is appropriately
> populated, you can revert to your original chart type.

You've lost me ... :(

Jon Peltier

unread,
Jul 29, 2003, 1:33:34 PM7/29/03
to

>>Before you get to this line, is the series formula
>>valid?
>
> Oh, absolutely ! It starts off with a previous (working)
> value, then calculates a new one, and then tries
> to "insert" it into the Chart.
>
> It grinds to a halt, and the values are there in
> the "Locals" window, and I can then use these to insert
> the figures manually, whereupon it works OK.
>
> However.... it frequently just keels over at that point !
> The Chart appears with a hatched box round it, and then
> Bingo ! Excel crashes....
>
> But it is ALWAYS at that particular line ! It works FINE
> for the other Series...

Sounds like a classic crash, all right.

I made your code work fine in a dummy worksheet. I wonder whether your
own workbook may be getting corrupt. Can you build a new workbook that
has your data and chart, then test it again?

>>Rumor has it, .... that
>>changing the series to an area type will enable you to
>>access the series formula in such a case.
>>Then when the series is appropriately
>>populated, you can revert to your original chart type.
>
>
> You've lost me ... :(

This is what I meant:

With ActiveChart.SeriesCollection(1)
myType = .ChartType
.ChartType = xlArea
.Values = _


"=Ali2!R" & VTPStartRow & _
"C2:R" & VTPEndRow & "C2"

.ChartType = myType
End With

Can't promise anything, and since your series formula is valid before
this happens, it probably won't help.

0 new messages