PC Review


Reply
Thread Tools Rate Thread

what is the code to close a file for a macro

 
 
Celia
Guest
Posts: n/a
 
      2nd Apr 2010
I need to close a file in a macro but I am not sure how to do it. I could
use the following but when I use this a pop up screen says do you want to
save the changes to the file. I don't want to save the changes. Is there
any code to use that will eliminate the pop up asking me to save the file.

ActiveWindow.Close



----
Celia
 
Reply With Quote
 
 
 
 
ozgrid.com
Guest
Posts: n/a
 
      2nd Apr 2010
Worbooks("Book.xls").Close SaveChanges:=False



--
Regards
Dave Hawley
www.ozgrid.com
"Celia" <(E-Mail Removed)> wrote in message
news:99DDAB63-FAFE-4276-9EE7-(E-Mail Removed)...
>I need to close a file in a macro but I am not sure how to do it. I could
> use the following but when I use this a pop up screen says do you want to
> save the changes to the file. I don't want to save the changes. Is there
> any code to use that will eliminate the pop up asking me to save the file.
>
> ActiveWindow.Close
>
>
>
> ----
> Celia


 
Reply With Quote
 
arjen van der wal
Guest
Posts: n/a
 
      2nd Apr 2010

or staying along the lines of your original code:

ActiveWindow.Close (False)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code macro to close Excel Application? Eric Microsoft Excel Programming 4 8th Jan 2010 07:51 AM
How to code the Macro to save and close a file? =?Utf-8?B?RXJpYw==?= Microsoft Excel Misc 7 10th Jun 2007 03:28 PM
Can I use code/macro to change code/macro in an existing file? =?Utf-8?B?U2NvdHQgQmVkb3dz?= Microsoft Excel Programming 2 14th Feb 2007 05:50 AM
VBA Code to kick off macro when workbook command to close is initi =?Utf-8?B?enVsZmVyNw==?= Microsoft Excel Misc 2 23rd Jun 2006 08:04 PM
Close worksheet with Macro or Code sanaullah Microsoft Excel Programming 1 2nd Oct 2003 08:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:17 PM.