Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Closing a file with macros

I want to close an excel file that has been modified but I do not want to be
ask if i want to save changes.. if I do as follows

Windows("Excel file name.xls").Activate
ActiveWorkbook.Close

Excel will ask me if I want to save changes... I do not want this... just
close it.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Closing a file with macros

hi
try this.........
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True

regards
FSt1

"Alberto Ast" wrote:

I want to close an excel file that has been modified but I do not want to be
ask if i want to save changes.. if I do as follows

Windows("Excel file name.xls").Activate
ActiveWorkbook.Close

Excel will ask me if I want to save changes... I do not want this... just
close it.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Closing a file with macros

Worked great thanks.

"FSt1" wrote:

hi
try this.........
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True

regards
FSt1

"Alberto Ast" wrote:

I want to close an excel file that has been modified but I do not want to be
ask if i want to save changes.. if I do as follows

Windows("Excel file name.xls").Activate
ActiveWorkbook.Close

Excel will ask me if I want to save changes... I do not want this... just
close it.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Closing a file with macros

Or

workbooks("Excel file name.xls").close savechanges:=false

No need to activate it first.

Alberto Ast wrote:

I want to close an excel file that has been modified but I do not want to be
ask if i want to save changes.. if I do as follows

Windows("Excel file name.xls").Activate
ActiveWorkbook.Close

Excel will ask me if I want to save changes... I do not want this... just
close it.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Closing a file with macros

It is a very good option and will allow me to do even more.

Thanks

"Dave Peterson" wrote:

Or

workbooks("Excel file name.xls").close savechanges:=false

No need to activate it first.

Alberto Ast wrote:

I want to close an excel file that has been modified but I do not want to be
ask if i want to save changes.. if I do as follows

Windows("Excel file name.xls").Activate
ActiveWorkbook.Close

Excel will ask me if I want to save changes... I do not want this... just
close it.


--

Dave Peterson



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
closing a variable file name with macros bigjim Excel Programming 5 May 8th 08 05:10 AM
Closing a Workbook if Macros aren't enabled. [email protected] Excel Programming 3 August 9th 07 08:00 PM
Enabling/Disabling Macros w/o closing & re-opening Conan Kelly Excel Programming 1 August 31st 06 12:38 AM
Closing Within Macros bodhisatvaofboogie Excel Programming 9 May 27th 06 03:09 AM
Error closing Excel after running series of macros PT_VBA_GRRL[_2_] Excel Programming 1 January 25th 06 09:20 PM


All times are GMT +1. The time now is 01:42 AM.

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

About Us

"It's about Microsoft Excel"