XL 2000: automating drag-and-drop for worksheet ranges. Using Code!
I think what you are asking is impossible. "Click, Hold, and Drag" already is assigned to a
function: extending the selection.
Even if you could implement this, I wouldn't recommend it unless your users never use Excel for
anything other than your application, or for that matter, any other Windows apps. Click, Hold
and Drag extends the selection in every other Windows app that I can think of. So you're really
trying to change some fundamental Windows behavior.
As far as controlling what users can and can't do, doesn't protecting the worksheet give you the
control you need?
Another option would be to get all user input via Forms and not allow the user to manipulate the
worksheet at all.
On Tue, 2 Sep 2003 11:37:47 -0700, "Bill Garcia" wrote:
Good suggestion. Here is the problem in a nut shell.
In XL when the user selects a cell, the default behaviour
is for the cell to become activated. If after selecting,
the user holds the left mouse button down while dragging,
a range of cells is highlighted.
However If the user wants to move the cell to another
address, he/she must then select the border of the cell,
hold down the mouse button and then drag it to the new
destination.
I want to click, hold and drag all in one step without
having to first select the cell, then the border.
It is all about controlling the UI and what I want the
users to do and not to do. I realize this is not a regular
question. I think this extends beyond the confines of the
environment.
But, hopefully not, somehow the application knows each
action. There most be an event that fires when the user
drags the pointer over the cell's border. This most be how
the app knows to change the mouse from xlDefault to
xlNorthWest. This is the event I want to tap into, but it
is not exposed and so far I have not been able to simulate
it.
Appreciate your comments. Thanks for the help.
BG
-----Original Message-----
I'm afraid I haven't clue how to answer your question.
Only responding because a) it's been hanging around, and
b) your OP is close to one I posted to which someone has
been good enough to answer (namely Tom Ogilvy).
So, my suggestion is to elaborate on your ultimate
objective.
Eg why do you want to automate Worksheet drag & drop. If
it's about move/copy ranges with mouse, events would be
triggered on select and change if you need to trap these.
Or maybe it concerns move/resize objects. Hopefully if
you
explain a little more someone far more expert might
suggest an alternative approach.
Good luck,
Dan
-----Original Message-----
Hello;
I have been looking for a solution that will enabled the
automation of drag-and-drop functionality for worksheet
ranges.
I have been looking at the different events which the
application and worksheet objects expose but they are
not
workable for what I need to do.
I've also looked at windows api functions that may help
but the problem here is that one still needs a
triggering
mechanism for these to work. Only fall back is, again,
the
application and worksheet events, which are not workable.
I wonder if there is a way to create a user defined
event
and somehow hook it up to the app so that it recognizes
it?
Perhaps is there a way to register events with the app
via
the registry or some other method?
Thanks in advance for your help and/or suggestions.
.
.
|