Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Programatically close a file without saving

Hello:
I need to be able to close a file programmatically, but when I try to
do so the Excel message: "Do you want to save the changes that you made
to ---" With the choices "Yes", "No" and "Cancel" comes off & I would
like to close the file without saving it.
I would appreciate help wit the above.

TIA
Vinay

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Programatically close a file without saving

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

Gord Dibben Excel MVP

On 25 Dec 2004 15:23:16 -0800, wrote:

Hello:
I need to be able to close a file programmatically, but when I try to
do so the Excel message: "Do you want to save the changes that you made
to ---" With the choices "Yes", "No" and "Cancel" comes off & I would
like to close the file without saving it.
I would appreciate help wit the above.

TIA
Vinay


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Programatically close a file without saving

You could also use one of these:

ThisWorkbook.Close SaveChanges:=False

or

Application.DisplayAlerts = False

Regards,
KL

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

Gord Dibben Excel MVP

On 25 Dec 2004 15:23:16 -0800, wrote:

Hello:
I need to be able to close a file programmatically, but when I try to
do so the Excel message: "Do you want to save the changes that you made
to ---" With the choices "Yes", "No" and "Cancel" comes off & I would
like to close the file without saving it.
I would appreciate help wit the above.

TIA
Vinay




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
Close file without saving Roadie[_4_] Excel Programming 0 October 22nd 04 03:21 PM
Close file without saving Roadie[_3_] Excel Programming 1 October 22nd 04 02:53 PM
Programatically saving XML file as Excel spreadsheet ANN Excel Programming 0 April 22nd 04 09:55 PM
Close file without saving data ExcelMonkey[_96_] Excel Programming 2 March 2nd 04 11:34 PM
Programatically saving an excel .csv file to .xls file... Pai Excel Programming 1 December 2nd 03 05:18 AM


All times are GMT +1. The time now is 09:21 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"