Hi all,
I've been working on some customized sparkline add-in for the company recently. But now there's a problem with my implementation, here's how:
Background:
While developing my sparkline UDF, I use "rand()" to generate some random data to test the result.
As we all know, "rand()" is volatile type of function which will refresh upon most of the user operations e.g. hitting "Del" key, auto-fitting row height / column width, workbook save / close, etc...
Problem:
Now the problem is: if I consecutively (say, 3 or more times) trigger the "row height autofitting" event (which will cause the "rand()" to refresh and then also refreshs my sparkline UDF), then if I wait for a sec or longer then trigger the refreshing of "rand()" again (by executing any kind of operation), my UDF will also refresh then the Excel crashes...
Test cases:
Funny thing is, this kind of crash seems to be caused ONLY by consecutive "row height autofitting". No matter how many times you auto-fitting a column width, Excel won't crash.
I suspect that the problem is fundamentally caused by the manipulation of "worksheet.shapes", because it will not crash if I comment out all of the statements concerning "shapes".
I have tried to debug this issue by stepping-in but failed because it seems that Excel only crashed after successfully executing my UDF.
Environment:
Windows XP + Office 2003.
I've attached a sample worksheet for your kind perusal.
Please help me... TQ.
Regards,
YM (puzzled)
Bookmarks