Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to handle all delete row events in excel
I want to handle all row deletes within Excel 2003. I have no trouble
with Worksheet Menu Bar/Edit/Delete because it is always there, but what about the context dependant items like Worksheet Menu Bar/Edit/&Delete Ro&w and Cell/&Delete/&Row These menu items appear in Excel when the selection is within a listobject. If I try to point a CommandBarButton to these items, I get "The parameter is incorrect" error, possibly because they don't exist in the menu at the time I am trying to create the object. If so, when can I do this? Not within the BeforeRightClick event for the sheet ( I have tried). I don't see an AfterRightClick event or a MouseUpEvent within the Excel Object Model. I've reference KB213552 List of ID numbers for built-in CommandBar controls in Excel 2000 without luck. I tried CommandBarControl Row CommandBarButton Delete, but this produced the "Parameter is incorrect" error. The following works: Dim mainCtr As Office.CommandBar mainCtr = DirectCast(m_xlApp.CommandBars("Worksheet Menu Bar"), Office.CommandBar) Dim ctr As Office.CommandBarPopup ctr = DirectCast(mainCtr.Controls("Edit"), Office.CommandBarPopup) mnuEditDelete = DirectCast(ctr.CommandBar.Controls("&Delete..."), Office.CommandBarButton) But this does not: mnuEditDeleteRow = DirectCast(ctr.CommandBar.Controls("Delete Ro&w"), Office.CommandBarButton) As an aside, I have not had problems with KB823988 and deletion of rows within list (entire row is selected) - for the one menu item I am able to handle. I appreciate any insight on this topic Thanks Tom Hughes |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Capturing excel insert/delete events. | Excel Worksheet Functions | |||
Capturing Insert/Delete Events in Excel Sheet using c# | Excel Worksheet Functions | |||
Which Events Fire When I Delete A Row, and How Many Times? | Excel Programming | |||
How to handle other workbook events through personal.xls workbook | Excel Programming | |||
Office2003: Handle events for web charting component | Excel Programming |