Solved

VB.net/VSTO Excel Add-in Handle row deletion event

Posted on 2013-05-10
3
1,173 Views
Last Modified: 2013-05-13
Hi

I currently use the following event in my Excel VB.net Add-in to handle changes to cells.
How do I handle the deletion of Excel rows

Private Sub Application_SheetChange(Sh As Object, Target As Microsoft.Office.Interop.Excel.Range) Handles Application.SheetChange
0
Comment
Question by:murbro
3 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39160830
There is no event specifically for inserting or deleting rows. You can use a named range well below the data you expect and then monitor its row number when the target.columns.count = sheet.columns.count (which it has to if you are inserting / deleting rows). If the row number has decreased then a row has been deleted.
0
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 39161269
As mentioned on previous post, Excel does not offer such event, but you can use the other events to monitor the number of deleted rows, for example check:
http://dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/
0
 

Author Closing Comment

by:murbro
ID: 39162056
Thanks very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now