LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default different value for setting with breakpoint vs regular running code

I'm creating a chart with two data series using vba. One data series is on the primary axis and one is on the secondary axis. In order for the chart to look correct, the two axis need to have the same max/mins. I have written code that does just this. Below is a portion of code from a much larger routine.

With ActiveChart.Axes(xlValue, xlSecondary)
.MinimumScale = ActiveChart.Axes(xlValue, xlPrimary).MinimumScale
.MaximumScale = ActiveChart.Axes(xlValue, xlPrimary).MaximumScale
End With

In my testing I'm using a chart with primary axis max=60, min=-30. The code always works for the maximum value. It also works perfectly for the min if I put a breakpoint in the code before "MinimumScale = ActiveChart....". However, if the code is called from Excel and runs freely (no breakpoints), or if the first breakpoint is after "MinimumScale = ActiveChart...", then VBA somehow concludes that the min=-40.

I'm finding this absolutely maddening. Does anyone know how to get Excel/VBA to work correctly?

Thanks!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code stops for one user, like it has a breakpoint Barb Reinhardt Excel Programming 1 December 18th 09 05:09 AM
Setting timer to run macro at regular intervals JLGWhiz Excel Programming 0 January 10th 09 06:05 PM
Setting timer to run macro at regular intervals Mike H Excel Programming 0 January 10th 09 05:18 PM
need breakpoint to stop code Souris Excel Programming 1 February 22nd 08 07:00 PM
Ignore breakpoint when running a macro hmm Excel Programming 5 January 1st 08 12:51 PM


All times are GMT +1. The time now is 09:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"