View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default Excel 2007, log chart issue

I was surprised that 2003 didn't give me thee message at all, even in manual
mode. I seem to recall being ticked at getting the message a hundred times
when one plot had lots of negative numbers.

Are the cells really blank, or do they contain formulas? if they are
formulas, maybe returning some value besides a simulated blank might help.
For other purposes, we use NA() to condition the result of a formula for
being left out of a chart. If the cells are or may be blank, link another
range to them, and likewise condition the blanks, then plot from this second
range. And before you say anything about having two ranges, think how nice
it would be if this stopped the messages.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Newsx" wrote in message
...

Thanks for that Jon, I tried the application.displayalerts trick and it
kind of worked, much like you mentioned.

The trouble is even if I leave displayalerts off all the time (which
causes its own issues) if I then do anything to the chart at all
(including moving an axis title etc) I get the error.

Since this is for a user base that isn't very technically aware I can't
really afford to have strange messages like that popping up :-(

It's odd in that Excel 2003 handles everything just fine, but Excel 2007
just doesn't want to deal with blank values.



In message , Jon Peltier
writes
In a very simple line chart with one series having one negative value,
when
I manually set the scale to logarithmic, I got the error the first time,
but
not subsequent times. It's as if Excel remembered it had already bothered
me
about this. Despite the warning, the axis was changed. When I created a
new
chart (which I had not been warned about) and used the VBA code, I got the
error; after clearing the error, the axis was changed. However, you want
to
avoid the error. I tried EnableEvents:

Sub LogScale()
Application.DisplayAlerts = False
ActiveChart.Axes(xlValue).ScaleType = xlLogarithmic
Application.DisplayAlerts = True
End Sub

but it did not prevent the message. I don't know what to suggest, but I'm
waiting to see what others may have to say.

I was using Excel 2007 SP1, as if it matters.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______



"Newsx" wrote in message
...

I'm trying to put together a piece of code in Excel, to be called by an
external application to regenerate graphs.

The offending code is this:

ActiveChart.PlotVisibleOnly = True
ActiveChart.DisplayBlanksAs = xlNotPlotted
ActiveChart.Axes(xlValue).ScaleType = xlLogarithmic


The process fails when trying to set the scaletype to logarithmic,
claiming that negative or zero values cannot be plotted.

There are no negative or zero values in the data series but there are a
number of blank cells. This works perfectly in Excel 2003 but Excel 2007
throws errors.

This is really doing my head in, so any pointers would be much
appreciated!


--
Confidence is what you have when you don't understand the situation




--
================================================== ====================
To reply by email remove the word master from before the @
Any email sent to reply-to address will be automatically rejected
Any email sent may be quoted in full or in part in relevant newsgroups
================================================== ====================
Confidence is what you have when you don't understand the situation