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.