Posts by ExcelSteve

    Re: Zooming on Charts with VBA


    Hi Rob,


    Thanks for the feedback, i see your point with the 'on error resume next' always a dangerous option!


    The changes made don't seem to resolve the problem. When the rectangle is drawn to show the required zoom area this prevents the 'mchtChart_MouseUp' in the CChart class operating. I checked this with a breakpoint in the sub and it never runs. However if you comment out the mousemove portion to modify the rectangle when the mouse is pressed it does fire the 'mchtChart_MouseUp' action and the zoom occurs.

    I have been working through Rob Boveys book on excel development and modified the examples of dynamic charting to attempt to allow the user to zoom into a chart with a rectangular shape defining the area.


    I have a mouse down action capturing the x and y co-ordinates and use the mousemove to show the expanding rectangular area, I then have a mouse up action to capture the last x and y coordinates and change the x-axis limits, imitating a zoom feature.


    The problem is using mousemove i cannot then use the mouseup to capture the last position and reassign the axis. Has anyone else experienced something similar?


    I have attached the semi-working file and currently have the 'mousemove' commented out to make it workozgrid.com/forum/core/index.php?attachment/33300/.


    If anyone has any clues as to why the interaction will not work i would appreciate the feedback.