Workbook_SheetSelectionChange in an Addin

R

rchan11

Hi,

I was wondering if someone could help me out. I've been trying to create an
addin for all our spreadsheets to create an audit trail writing each cell
change to a database, however, when I override the
Workbook_SheetSelectionChange procedure in the addin module, a cell change
never invokes the commands within the procedure.

It seems that the only Workbook_SheetSelectionChange code that it will
invoke is from ThisWorkbook or local code. Is it possible to create an addin
that will trigger an insert to a database with every cell change?

Thanks in advance,
Ryan
 
T

Tom Ogilvy

You addin has to instantiate Application Level events. Chip Pearson shows
you how at
http://www.cpearson.com/excel/appevent.apsx

you would then use the application level version of the event you speak of.
it will pass in a reference to the sheet that triggered the event

Private Sub object_SheetSelectionChange(ByVal Sh As Object, ByVal Target As
Excel.Range)
 
D

Dave Peterson

All workbooks is a pretty large number! You may want to limit your code to
certain workbooks (based on name or location or a hidden name or ...).

But the type of event you're looking for is called an application event.

You can start by reading Chip Pearson's notes:
http://www.cpearson.com/excel/AppEvent.aspx
 
R

rchan11

Thanks Tom and Dave for your quick responses! I'm relatively new to Excel
Programming so I'll give those 2 comments a try.

Thanks again,
Ryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top