none
Disabling "Fill handle Cell Drag and Drop" option from Excel Options RRS feed

  • Question

  • Hi,

    We would want to disable the OOB "Cell Drag and drop" feature provided by Microsoft Excel using VSTO 2010. We have implemented the below code to do so

    this.Application.CellDragandDrop = false;

    This works fine as long as the user does not change the property from Excel Options (Office Excel button --> Excel Option --> Advanced --> "Fill Handle Cell Drag and Drop") Is there a way to disable this Option using VSTO 2010

    Could any one help us to completely disable this option, user should not be allowed to use "Fill Handle Cell Drag and Drop" feature copletely.

     

    Thank you,

    Paramesh.

    Thursday, July 21, 2011 6:50 AM

Answers

  • Hello Paramesh,

    A quick and dirty way is to disable the Ribbon command MsoId="ApplicationOptionsDialog". A more correct way is to use wait for the Options dialog to close and then check if ExcelApp.CellDragAndDrop requires resetting. I suppose you need to use Windows API to achieve this.


    Regards from Belarus (GMT + 2),

    Andrei Smolin
    Add-in Express Team Leader
    Thursday, July 21, 2011 7:48 AM

All replies

  • Hello Paramesh,

    A quick and dirty way is to disable the Ribbon command MsoId="ApplicationOptionsDialog". A more correct way is to use wait for the Options dialog to close and then check if ExcelApp.CellDragAndDrop requires resetting. I suppose you need to use Windows API to achieve this.


    Regards from Belarus (GMT + 2),

    Andrei Smolin
    Add-in Express Team Leader
    Thursday, July 21, 2011 7:48 AM
  •  

     

    Hello Paramesh,

    It looks like Andrei Smolin’s quick and dirty approach is the solution.  If you download the Control ID’s tables from MSDN and search the ExcelControlID.xlsx file for the sub-controls under the ApplicationOptionsDialog there aren’t any. That is a big group to disable, but doing so will keep your end-users from accessing the checkbox for Enable fill Handle and cell drag-and-drop.

    Actually, the members of the ApplicationOptionsDialog are components of a dialog box that doesn’t appear like your usual dialog box. They are controls and labels that are members of the dialog box.

    Here are links to several other Forum posts that share your problem. The second one has an extensive content that links to other content, including a link to the download page for the Office 2010 ControlID documents.

    How do I make the Excel Options button invisible from the ...
    http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/f311b391-c223-44fe-aab3-1dfd709b7a5a

    Hide backstage button
    http://social.msdn.microsoft.com/Forums/en/vsto/thread/fe93a0d5-0b92-45a7-b39d-f4a5437de1db

    Please let us know whether you are satisfied with the information above. Thanks.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Friday, July 22, 2011 5:45 PM
    Moderator