![]() Private Function IsEditing () As Boolean Dim cBars As Office.CommandBars = ExcelApp.CommandBarsĭim cBar As Office.CommandBar = cBars.Item( "Standard")ĭim cControls As Office.CommandBarControls = cBar.Controlsĭim cControl As Office.CommandBarControl = cControls.Item( "New")ĭim result As Boolean = Not cControl.EnabledĪlthough the code above does work in Excel 2000-2010 (because the command bar controls are just hidden from the user), it is subject to many issues: it depends on the availability of the command bar and control. Here is a code sample that uses one of such control: ' wrong version In the UI of Excel 2000-2003, you can find heaps of commandbar controls that become disabled in this scenario. The code below is based on the fact that certain command bar controls in Excel become disabled when you type in a cell. Now how to determine that Excel is in the edit mode? A non-solution ![]() Here’s a typical scenario: your code modifying a workbook fails because the user types something into a cell.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |