How to dismiss password entry dialog box?

Trying to modify and save under different name a password protected MS excel file, but the question likely applies to protected MS word file as well.

Some sent to me a MS excel password protected file (report) I’m planning to use as a template for future reports.
I can keep editing file and hit “save” button within timeout time, and it all works OK. But if a dialog box appears that the file cannot be exported (which I’m not planning to do and can’t find how to disable) and asking to enter a password which I don’t know, the box cannot be dismissed, nor editing since last “Save” action. LO cannot be quit either, so gets stuck in this mode, and the only way to kill the application is using task manager.

It must be a way to at least close application gracefully, let alone allow to dismiss the dialog in order to save work.
Any advice?