|
-
Mar 27th, 2015, 12:53 PM
#1
Thread Starter
Fanatic Member
How to debug plotting error
Using VBA modules in a data analysis application to compute statistical results that I update to an Excel worksheet with existing plots (i.e. the plots aren't created each time but automatically update because the underlying data changes). Several plots use log scale. None of the result are negative and I've taken great pains to make sure none of the results are zero by making sure any result is at least E-17.
From time to time get the annoying dialog box with the message that "Negative or zero values cannot be plotted on log charts" but cannot for the life of me find any result that is zero or negative. Since Excel found something it didn't like, is there any way to further investigate exactly what it doesn't like? It is sort of like going to a doctor with a pain but not revealing the location of the pain.
Last edited by VBAhack; Mar 27th, 2015 at 12:59 PM.
-
Mar 27th, 2015, 03:00 PM
#2
Re: How to debug plotting error
Where are you storing the data that is attempting to update the graphs? Is it all visible?
-
Mar 27th, 2015, 05:59 PM
#3
Thread Starter
Fanatic Member
Re: How to debug plotting error
 Originally Posted by vbfbryce
Where are you storing the data that is attempting to update the graphs? Is it all visible?
Data is stored in worksheet cells and is visible. That's how I know nothing is negative or zero.
-
Mar 27th, 2015, 06:39 PM
#4
Re: How to debug plotting error
It is hard to say what is happening with out the ability to see the code and the spreadsheet setup, but perhaps it is due to some calculation taking place on partially revised data.
Try disabling automatic calculation prior to updating the values.
Code:
Dim currentMode As XlCalculation
currentMode = Application.Calculation
Debug.Print ThisWorkbook.CalculationVersion
Application.Calculation = xlCalculationManual
' your code
Application.Calculation = currentMode
Application.Calculate
Debug.Print ThisWorkbook.CalculationVersion
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|