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


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