Is it possible to prevent error message displays?

M

MAB

I have an Excel 2003 file that is giving me the following error message when
I open it, or click on one of the graphs in the file:

“Negative or zero values cannot be plotted correctly on log charts. Only
positive values can be interpreted on a logarithmic scale. To correct the
problem, do one of the following:â€

Of the two suggestions listed to fix this problem, one is not an option (do
not use -0 amounts), and the other does not work (clearing the Logarithmic
scale checkbox).

Can I use the “Application.DisplayAlerts = False†command when opening the
file in order to prevent the error from shoeing? If so, where would I use it
or where would I insert it? I’m not educated in creating code or extensive
macro work.

Thank you in advance.
 
A

acampbell012

In the Thisworkbook module, Try the following code:

Private Sub Workbook_Open()
Application.DisplayAlerts = False
End Sub

One word of caution, not setting alerts back to true can suppress other
messages you intend to display elsewhere.
 
M

MAB

I don't have a Thisworkbook module. I just see Module1 and Module 3. Any
ideas?

Thanks.
 
A

acampbell012

In the VBA project explorer expand the "VBA Project (Yourworkbook.xls)
folder. Then expand the "Microsoft Excel Objects" folder. The workbook
module is below this level.
 
M

MAB

Oh my... :p

Could I then use this in the same module?

Private Sub Workbook_Close()
Application.DisplayAlerts = True
End Sub

Thanks again.
 
T

Tom Ogilvy

why not see if it works first. My **guess** is that the message is being
displayed before the macro runs - but you tell us.
 
M

MAB

Yeah, sorry, I should have tried right away.

I just tried that code and the error message still displays.
 
S

stevebriz

Here is any idea you can try...To be honest I am not sure it will work
for you..but it might be worth a try.
In you work book add.

Private Sub Workbook_Open()
Err.Clear
End Sub

then in the event like click for your form
add some code like:

Private Sub CommandButton1_Click()

On Error GoTo errorhandle
' your task

Exit Sub
errorhandle:

Err.Clear
End Sub
 
T

Tom Ogilvy

Is this posted in the correct thread? It doesn't appear to have any
relevance to this thread
 
T

Tom Ogilvy

The problem as I understand it is you want to use a graph type with data
that is not supported by that graph type.


I would say you need to transform your data so it works with the graph type,
then label your graph so it appears to represent the original values.

Or you can use a dummy column perhaps and suppress the incompatible values,
then graph that.
 
M

MAB

I will try this.

Thanks for all your help.

Tom Ogilvy said:
The problem as I understand it is you want to use a graph type with data
that is not supported by that graph type.


I would say you need to transform your data so it works with the graph type,
then label your graph so it appears to represent the original values.

Or you can use a dummy column perhaps and suppress the incompatible values,
then graph that.
 
A

acampbell012

Try a search in this group using part of your error message. There are
a few other threads that may yield some results.
 
D

Damien

Hi,

Try the code below, place it the 'This Workbook' module as per the below
email thread.

Private Sub Workbook_Open()
ThisWorkbook.Application.DisplayAlerts = False
ThisWorkbook.Charts.Application.DisplayAlerts = False

End Sub

Good luck,

Damo
 
W

Whitey Magic

Guys, it's a bug in Excel (99% chance) or a virus (1% chance).

Reasoning:
I regularly get the same error message on a spreadsheet of mine. Th
spreadsheet contains a logarithmic chart but none of the values ar
ever zero or negative. The spreadsheet contains no macros. I have
firewall and multiple anti-spyware and anti-virus programs running an
have used them to check the spreadsheet and they all say it's fine.

PS
Sorry if this is the wrong forum :-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top