Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capturing excel insert/delete events. Gaurav Nanda[_2_] Excel Worksheet Functions 1 July 10th 09 11:09 PM
Capturing Insert/Delete Events in Excel Sheet using c# Gaurav Nanda[_2_] Excel Worksheet Functions 0 July 10th 09 06:14 AM
Which Events Fire When I Delete A Row, and How Many Times? Alan Excel Programming 2 September 21st 04 10:50 PM
How to handle other workbook events through personal.xls workbook ivarsb Excel Programming 1 July 27th 04 01:35 PM
Office2003: Handle events for web charting component Sunil K Excel Programming 0 February 9th 04 02:26 PM


All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"