Serving the Quantitative Finance Community

 
User avatar
SteveG
Topic Author
Posts: 0
Joined: September 26th, 2002, 2:43 pm

Excel crashing on exit

February 5th, 2003, 3:55 pm

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.
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

Excel crashing on exit

February 5th, 2003, 4:25 pm

What, if anything do you get from the debugger ?
 
User avatar
SteveG
Topic Author
Posts: 0
Joined: September 26th, 2002, 2:43 pm

Excel crashing on exit

February 5th, 2003, 4:36 pm

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.