Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default what is the code to close a file for a macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 464
Default what is the code to close a file for a macro

Worbooks("Book.xls").Close SaveChanges:=False



--
Regards
Dave Hawley
www.ozgrid.com
"Celia" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default what is the code to close a file for a macro


or staying along the lines of your original code:

ActiveWindow.Close (False)
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to close and reopen file Mr Bunj[_2_] Excel Programming 5 June 16th 08 02:05 PM
How to code the Macro to save and close a file? Eric Excel Discussion (Misc queries) 7 June 10th 07 03:28 PM
Close file and run macro from newly opened file Pradip Jain Excel Programming 1 April 23rd 05 11:39 PM
VBA code to automatically close file Kevin Excel Programming 4 November 6th 03 04:18 PM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 11:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"