Hello,
I want to disable drag and drop in my workbook.
So I put this code in "ThisWorkbook" :
It works, but when another vba code generate an error (error 400, it appears sometimes, even I try to prevent all them...), I have to close excel and reopen it to make my workbook works again. BUT if I do not reopen my workbook and open an all new excel workbook (to start a new projetct), the drag and drop is still desactivated
.
I know how to do (reopen my workbook with vba code and clode it) but my users won't do it...
Do you know a way to prevent that please ? It 'd be great !
I want to disable drag and drop in my workbook.
So I put this code in "ThisWorkbook" :
Code:
Private Sub Workbook_Activate()
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
End Sub
It works, but when another vba code generate an error (error 400, it appears sometimes, even I try to prevent all them...), I have to close excel and reopen it to make my workbook works again. BUT if I do not reopen my workbook and open an all new excel workbook (to start a new projetct), the drag and drop is still desactivated

I know how to do (reopen my workbook with vba code and clode it) but my users won't do it...
Do you know a way to prevent that please ? It 'd be great !