View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier[_4_] Jon Peltier[_4_] is offline
external usenet poster
 
Posts: 90
Default Converting MouseDown Coordinates to Chart Point Coordinates

Steven -

Zoomfactor can mess up your best algorithms. Copy a chart on a 100%
zoomed page, change the zoom to 75%, and paste the chart: it's 75% as
large as the original!

In Excel 97, you get goofy results formatting the plot area size if the
entire chart isn't completely visible in the window. And this means it
can't butt against the top of row 1 or the left of column A. I used to
work around that by scrolling the sheet, nudging the chart slightly,
then unnudging the chart and scrolling back. With screenupdating =
false to reduce nausea.

I was doing a little thing using mouse events to draw a shape on a
chart, and I've crashed Excel twice. So I've got nothing intelligent to
add at this time.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

steven ritter wrote:

Thanks for the help. I can make use of that, but it's not quite what I
want to do -- I don't think I was real clear in my initial problem
statement. I want to respond to the user mouse clicks to automatically
build the shape, so that the x,y coordinates of the MouseDown Event set
the anchor for the shape, and the x,y coordinates passed back by the
MouseMove Event resize the shape. I've got it working except if the
Excel zoom factor changes. Then my transformation from mouse x,y to
shape X,Y seems to change in some unpredictable manner. I may be
hallucinating, but the behavior also seems different if not all of the
chart is visible in the window.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!