The solution I have found was:
Code: Select all
Sub Close_Calc()
ThisComponent.Close(True)
End Sub
If I associate the same macro to the event: document is going to be closed, it work, but just after that, I get a message saying that my Calc crashed.
How can I fix this?