Excel AppEvents Issue in C#

P

Phil Boakes

Hi

I've written a C# Excel AddIn which is working nicely, but I am having 2
issues:

1). I have problems with the AppEvents_SheetChange event. It hooks fine and
seems to work, but I have noticed that after a certain period of time it
fails to exceute until I close Excel and reopen it. Strange behaviour. I
tried to narrow which piece of code was causing the issue and ended up with a
single line of code incrementing a static int counter which still failed
after about 3000 calls.

Has anyone else noticed this behaviour. Is it possible I am using old PIAs
or an old Excel version. Is there a fix for this or am I hooking the event
wrongly ?

2). Second problem is I have a COM method that I use as a worksheet function
which accesses the range it is dependent on to pick up an array or the Values
for the range via .Value2. This all works OK, but, if the user enters data
downwards through the range at a VERY fast pace (I mean as fast as possible)
then sometimes the next cell being entered seems to return a value of null.
i.e. it seems that excel doesn't lock the range values even though it is
calling a calculation based on the range. This seems like very strange
behaviour as well. Surely it should leaves the old values intact until the
outstanding calculations have completed before starting to update the cell.
At minimum it shouldn't allow any functions to execute with the cell data
halfway through an update?

My Excel Version reports 2003 11.8105.8122 SP2

Many Thanks in advance

Phil Boakes
 

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