sameera

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.



Re: Visual Studio Tools for Office Disable VSTO toolbar when cell is being edited

Peter Jausovec

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.






Re: Visual Studio Tools for Office Disable VSTO toolbar when cell is being edited

sameera

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.




Re: Visual Studio Tools for Office Disable VSTO toolbar when cell is being edited

Dennis Wallentin

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.






Re: Visual Studio Tools for Office Disable VSTO toolbar when cell is being edited

sameera

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