Re: Closing Workbooks



Hi Bodhisatvaofboogie,

Try:

Application.EnableAlerts = False

'Your closing code

Application.EnableAlerts = True


---
Regards,
Norman



"bodhisatvaofboogie" <bodhisatvaofboogie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:F134C27E-7876-4425-9B6D-A1FED8435DBF@xxxxxxxxxxxxxxxx
I have two possible requests, which ever is easiest will be the best
choice.
:)
A macro I'm working on opens up extra work books for the purpose of
pasting
various filtered data (it's fairly complicated, was the only way I could
think to extract the data exactly how I wanted). The end resulting
workbook
is the keeper, everything else I want to have close. SO Here is what
I've
been playing with:

Windows("Book1").Activate
ActiveWorkbook.Close savechanges:=False
Cells.Select
Selection.Copy
ActiveWindow.Close savechanges:=False
Cells.Select
Active***.Paste

The only problem with this is that two caution windows pop up. It would
be
nice if the macro could just auto answer and I wouldn't have to pay
attention
to it.
1: Asking do you want to save the information copied on the clipboard for
pasting later
What does the code look like for it to auto answer yes to that
question?
2: Asks do you want to paste anyway? The data being pasted is a
different
size.
What does the code look like for it to auto answer yes to that
question?

That would solve everything, leaving a single workbook open. BUT if there
is an easier way, perhaps a formula that will close everything EXCEPT for
the
last one (in this case "Book2" ) That just seems like it would be
simpler,
but I haven't the foggiest what the code would look like. Any ideas???
THANKS!!!


.