ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable Drag & Drop (https://www.excelbanter.com/excel-programming/375520-disable-drag-drop.html)

Stewart

Disable Drag & Drop
 
How can you programically disable the drag & drop EDIT from the application
so it is no longer an option under TOOLSOPTIONS while the workbook is open?

Excel 2003

Sandy

Disable Drag & Drop
 

Application.CellDragAndDrop = False

Sandy


Stewart wrote:
How can you programically disable the drag & drop EDIT from the application
so it is no longer an option under TOOLSOPTIONS while the workbook is open?

Excel 2003



Stewart

Disable Drag & Drop
 
Thanks Sandy, but this is only a temporary fix as the user can reactivate it
through the menu.

I want to remove/disable the option while my workbook is open.


"Sandy" wrote:


Application.CellDragAndDrop = False

Sandy


Stewart wrote:
How can you programically disable the drag & drop EDIT from the application
so it is no longer an option under TOOLSOPTIONS while the workbook is open?

Excel 2003




Sandy

Disable Drag & Drop
 
Put this code in the ThisWorkbook level of Visual Basic Editor. This
will disable the options drop down and then disable drag and drop when
the workbook is active. Then when the workbook in deactive (in the
backround) the both of the above will be enabled. This will let you
drag and drop/use option drop down on other workbooks that are open

Private Sub Workbook_Activate()
Application.CommandBars("Tools").Controls("Options ...").Enabled = False
Application.CellDragAndDrop = False
End Sub

Private Sub Workbook_Deactivate()
Application.CommandBars("Tools").Controls("Options ...").Enabled = True
Application.CellDragAndDrop = True
End Sub


Sandy

Stewart wrote:
Thanks Sandy, but this is only a temporary fix as the user can reactivate it
through the menu.

I want to remove/disable the option while my workbook is open.


"Sandy" wrote:


Application.CellDragAndDrop = False

Sandy


Stewart wrote:
How can you programically disable the drag & drop EDIT from the application
so it is no longer an option under TOOLSOPTIONS while the workbook is open?

Excel 2003






All times are GMT +1. The time now is 01:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com