PDA

View Full Version : [SOLVED] Close workbook without save prompt?



Ago
04-09-2014, 12:37 AM
I have a macroenabled workbook at work that helps my colleagues.

When the user chooses to save the workbook it creates a copy of the first sheet and saves it as a new workbook.
This because I don't want to save it with the macrocode, only the sheet needs to be saved.

After that is done the macro closes the "new" workbook and goes back to the macroenabled workbook.
At this stage the user needs to close Excel but he/she gets the prompt "do you want to save".
How can I disable this prompt?

I have tried with application.displayevents = false in beforeclose sub
But that doesn't seem to work.
Any suggestions?

Bob Phillips
04-09-2014, 01:35 AM
Why don't you close Excel in the code?

Ago
04-09-2014, 01:56 AM
You mean close Excel in beforeclose sub?

That could work.

Ago
04-09-2014, 02:48 AM
It works perfectly!

Thanks!