OK, I've done some additional testing on my own.  I wrote a test
worksheet that utilizes the Workbook_SheetChange event at the Workbook
level, the Worksheet_Change event at the sheet level, and I created
two identical classes that trap a sheet event using WithEvents. So
far, I believe what I've discovered is that class-based events fire
first, followed by worksheet events, then workbook-level events.

This means that if I write a class to capture sheet change & select
events, I can capture all user input to the spreadsheet cells
themselves.  Additionally, if I write a class to act as an
intermediate dispatcher for all onAction calls with shapes, I should
be able to capture any sheet-based action after a VBA crash and reset
all my classes via the class I've defined.

On Jan 27, 4:45 pm, RationalIcthus <christopher.l...@gmail.com> wrote:
> When I build an instance of a class that I've created in Excel VBA,
> then enter Design Mode (or if an unhandled error occurs) my object
> variables disappear (I think because code execution stops
> completely).  Problem is, if I'm trying to maintain state within a
> class across the life of an Excel application, those errors cause me
> to have to re-initialize all of my objects.
>
> What I'm trying to figure out is a way to *detect* when the VBA
> environment goes "down" and needs to be re-initialized. Has anyone had
> any success in this area?
>
> Chris

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,700 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to