Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Workbook_SheetSelectionChange in an Addin

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Workbook_SheetSelectionChange in an Addin

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)

--
Regards,
Tom Ogilvy






"rchan11" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Workbook_SheetSelectionChange in an Addin

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

rchan11 wrote:

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


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Workbook_SheetSelectionChange in an Addin

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

"Dave Peterson" wrote:

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

rchan11 wrote:

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


--

Dave Peterson

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
setup project for Excel addin, won't register addin Gerry Excel Programming 0 October 31st 07 12:01 AM
Workbook_SheetSelectionChange in going infinite sency Excel Programming 2 February 17th 07 05:44 AM
Unshimmed Automation Addin and Shimmed COM Addin in same App Domai Brandon Excel Programming 0 June 27th 06 11:18 PM
Improving Workbook_SheetSelectionChange for enhanced Autofiltering aafraga[_2_] Excel Programming 5 April 10th 06 01:11 PM
Workbook_SheetSelectionChange R.VENKATARAMAN Excel Programming 3 January 23rd 05 11:44 AM


All times are GMT +1. The time now is 03: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"