Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable drag and drop

Status
Not open for further replies.

gautammalkani

Technical User
Sep 29, 2003
51
US
Hi All

Everytime a user of a customized template does a drag and drop, it takes away the format of the cell. Is there a way to disable the drag and drop for the user?

Thanks

Gautam
 
For Excel:
Application.CellDragAndDrop = False

Paranoid? ME?? WHO WANTS TO KNOW????
 
Hi

Thanks for your help. I put in this command but I cannot fill down with this command. Ideally I would like to fill-down or fill-right but I dont want to drag the cell to a neighboring cell since it removes the format of the cell.

I hope this makes sense. I want to prevent the following:
The cell is cut from cell A1 from my mouse and dragged to B1.

Thanks

Gautam
 
Sorry, I have no experience with VBA in Excel, I just happend to have seen that command before.

Can you trap the event itself and programmatically set the cell format each time a drag and drop event occurs?

Or trap the mouse events involved and do an automatic function call that returns false each time which would effectively cancel the attempt but would allow your fills to still operate?

Just taking guesses though.
Good luck.

Paranoid? ME?? WHO WANTS TO KNOW????
 
Looking at what you searched for in other posts, my suggestion is either protect the worksheet and lock its editiing options or teach user how to work in excel.
You can create interface using userforms for instance and programmaticaly protect worksheet, after protection with UserInterfaceOnly:=True (repeated every time you open the workbook), you can then freely operate with vba code.

CellDragAndDrop does not prevent from cut & paste. Moreover, it is still possible to use copy & paste where format is copied too, paste from another worksheet, user can use shortcut keys or popup menu.
When you try to selectively (user/workbook) lock some application level functionality it can be problem to restore it when user opens a workbook, adds new page etc., especially after switching to design mode.
Having all that in mind, I prefer to secure workbook, and excel dimmes commands that are not available.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top