locked
Disable VSTO toolbar when cell is being edited RRS feed

  • Question

  •  

    When you start typing in on a cell, Excel 2003 disables some standard toolbar buttons. How can I achieve the same effect for my VSTO toolbar buttons. I've looked for an event such as ThisWorkbook.CellStartEdit, but there seem be be none that matches what I'm looking for.

     

     

    Thanks.

    Monday, October 1, 2007 10:23 AM

Answers

  • Hi,

    There's no such event in ThisWorkbook. But there's an event called Change on sheet level (e.g. Sheet1, Sheet2, ...), maybe you can put it to use somehow.

    Tuesday, October 2, 2007 2:12 AM

All replies

  • Hi,

    There's no such event in ThisWorkbook. But there's an event called Change on sheet level (e.g. Sheet1, Sheet2, ...), maybe you can put it to use somehow.

    Tuesday, October 2, 2007 2:12 AM
  •  

    I've used Change event for something before, and it fires after the user has finished editing (by hitting Enter or Tab). What the problem here is that people click on the toolbar buttons without finishing the edit. Some of these buttons trigger code that reads the current cell and when the cell is not committed (editing completed properly), this throws memory read exceptions or behave unpredictably. So I just want to prevent them from clicking on the buttons without exiting the currently editing cell.
    Tuesday, October 2, 2007 4:27 AM
  • It's not possible to track when Excel goes into edit mode and it's not possible to execute any code when Excel is in edit mode,

     

    I believe that the closest solution is to use the Worksheet_Change event where You check if the active cell is within the Target address, If so the code should disable the wanted buttons.

     

    Tuesday, October 2, 2007 8:00 AM
  •  

    Sadly this is not an option.

    If the toolbar was disabled when the cell range was entered, that defeats the whole functionality of the toolbar. And if the toolbar action wasn't dealing with the current active cell, probably the memory read errors will not happen either.

     

    Excel disables toolbars when the user starts typing. Why isn't there a way for us to od the same?

    Thursday, October 4, 2007 5:44 AM
  • Hi Sameera,

    I am trying to do same and i also have checked that its working cool way with excel default option.

    I hope there will be some way to achive and any how i will try to achinve.



    Thursday, February 12, 2009 12:17 PM