Closing a window after transferring data

J

JHB

I have a file from which I have done a copy/paste for a fair amount
of data. I have a macro to do this, and wish to close the window
totally. However when I use:

ActiveWorkbook.Close

I get a message asking whether I want to save the data on the
clipboard. I have looked in "help" for options to supress this
message, but cannot find them.Can someone give me the answer please.
Question is: How do I set the macro to avoid this message when
closing!!

Thanks in advance

John Baker
 
F

FSt1

hi
usually the best method is to turn off alerts at the begining of the macro
then turn them back on at the end.

Application.DisplayAlerts = False
your code here
ActiveWorkbook.Close
Application.DisplayAlerts = True

regards
FSt1
 
J

JHB

hi
usually the best method is to turn off alerts at the begining of the macro
then turn them back on at the end.

Application.DisplayAlerts = False
your code here
ActiveWorkbook.Close
Application.DisplayAlerts = True

regards
FSt1

Thanks..very helpful!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top