ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB Syntax to close Excel workbook not saving changes (https://www.excelbanter.com/excel-programming/413580-vbulletin-syntax-close-excel-workbook-not-saving-changes.html)

Greyman

VB Syntax to close Excel workbook not saving changes
 
In Excel 2000, I want to automate closing a file without saving changes.
This code does not give any error messages, but closes and does in fact save
the changes:

Sub DoNotSaveChanges()
'
' DoNotSaveChanges Macro
' Macro recorded 5/07/2008 by Grahame McEnery
'

'
ActiveWorkbook.Close (SaveChanges = False)
End Sub

ward376

VB Syntax to close Excel workbook not saving changes
 
activeworkbook.Close SaveChanges:=False

Cliff Edwards


All times are GMT +1. The time now is 07:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com