Disable then Enable Drag & Drop - on Open and Close...

poolio

New Member
Joined
Oct 8, 2010
Messages
43
This should be an easy one but I'm struggling to enable Drag & Drop when I close down my Workbook, I can disable when I open with:

Private Sub Workbook_Open()
Application.CellDragAndDrop = False
End Sub

But when I close it down... this doesn't seem to work:

Private Sub Workbook_Close()
Application.CellDragAndDrop = True
End Sub

In fact it leaves it disabled for any workbook I subsequently use....

Should I be saving them both into the This Workbook in VB, or into a Module (what's the difference #blush#)

Thanks
Jim
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try this instead of the second one. Both go in the ThisWorkbook module

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.CellDragAndDrop = True
End Sub
 
Upvote 0
Try this instead of the second one. Both go in the ThisWorkbook module

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.CellDragAndDrop = True
End Sub

VoG,
Thanks for the reply, it's not bad, as it re-enables D&D on any save; so assuming people saved just before they exit it would be perfect. However if someone were extensivly inputting into the sheet and wanted to do a quick [Ctrl+S] mid modification, then the D&D would be reactivated = danger! So I really ONLY need it to be re-activated during the, Exit process... is there an alternative to: Workbook_Close() ?
 
Upvote 0
How about this

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CellDragAndDrop = True
Me.Save
End Sub
 
Upvote 0
Mr VoG... sir, you are a gosh darned Genius! :):):)

As the yoof might say 'nuff respeck guy'!

How about this

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CellDragAndDrop = True
Me.Save
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,749
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top