Page 1 of 1

Excel crashing on exit

Posted: February 5th, 2003, 3:55 pm
by SteveG
I have an addin that I have written for Excel that uses a XLL and I have just changed all the formulas to be non-volitile by using the # sign rather that the ! sign as the last value in the Type_text arg, however now when I quit Excel, and Excel prompts me to Save, Cancel or ??, I select Save and Excel falls over in a big heap giving me an error. And before you all mention it, I know about the bug on the cancel button, is this related to that problem?Cheers for any helpSteve.

Excel crashing on exit

Posted: February 5th, 2003, 4:25 pm
by DominicConnor
What, if anything do you get from the debugger ?

Excel crashing on exit

Posted: February 5th, 2003, 4:36 pm
by SteveG
sorted it now, yeah the problem is all down to the xlAutoClose event being fired too early by Excel. Microsoft seem to fire this event before the dialog box to save work appears, and we had some code in there that closed down all our DB connections, and so when the user clicked Yes to save, Excel was recalulating the sheet trying to use our formulas which had no DB connections and so caused an error.So to fix the problem we have removed the killing of DB connections from this event and now just hope that ADO will kill them off when it gets killed off by Excel, this was the same bug as we had with the cancel button. If a user went to exit Excel using the close button in the top right hand corner, then decided to stay in Excel and so clicked cancel, our XLL would have closed all the DB connections. Bloody MS, why can't they write software that has useful events that us the programmer can use.Anyway cheers for the interest. If you know of a better to find when Excel does actuall close down I would be greatful as this will save me having to rely on ADO closing them down.Steve.