Macro - Mouse Move Shape or Drag and Drop

  • Thread starter Thread starter magicmen
  • Start date Start date
M

magicmen

I've been playing around with this macro for a couple of days in hopes of
using it for moving game board pieces (like Chess pieces). I understand that
there is another macro out there (created by Hans Werner Hofmann / Ute Simon)
but, from the places where I've downloaded it, it does not allow you to see
the source (understandable). Thus, I've been using the macro from:

http://officeone.mvps.org/vba/mousemove_shape.html

This macro seems to work properly where you click the object that you want
to move and, by tracking the location of the mouse, applies the same
translation vector to the object being clicked. However, this function is
very choppy and I would like to increase the refresh rate of this
calculation. Basically, I think I've narrowed it down to the "SetTimer" part
of the code but I haven't been able to figure out (even tried Googling) the
arguments associated with the command. I've also tried changing the values
but did not observe any significant changes.

Essentially, I would like the objects that I am moving to move along with
the mouse (which will be moving short distances so it won't look choppy like
a movie with missing frames). The slideshow itself is very small in size
(less than 300kb) and I also have 2GB of ram to back up any questions on
performance. Any help would be greatly appreciated.

Thanks!

Sean
 
Thanks John. Yes, I understand that it was set to 10 milliseconds but
changing that value to 1 millisecond and it is still very bad. Would you
happen to have any other recommendations of accomplishing this task? Are
other macros more efficient for this type of drag and drop action?

Thank you for your time.

Sean
 
I think I found the (simple) solution. First, I visited the dead gekko page

http://www.deadgekko.co.uk/downloads.htm

and downloaded the source for the VB code. The one at this site is
different (and somewhat streamlined) from the other one that I had. Of
course, I don't think the actual efficiency of the code is noticeably
different. Instead, what ended up making the difference was the number of
images on the slide that appeared to be slowing down the slide itself. This
is likely a memory issue (even with 2gb of ram). All I did was keep my
entire presentation in tact and removed all of the images from the one slide
where I had the drag and drop macro and it moved faster than ever. What I'm
going to do is combine all of the images and have it as one background image
and that should do the trick.

All hail the drag and drop macro.

Thanks for all of your dedication and guidance!

Sean
 
Back
Top