View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Shawn Shawn is offline
external usenet poster
 
Posts: 271
Default Don't ask to save changes

I pasted your code into my "ThisWorkbook" object and made some chages to the
spreadsheet then clicked the "x" to close the program and it still prompted
me to save changes???
--
Thanks
Shawn


"Corey" wrote:

Sub CloseandSave()
Application.DisplayAlerts = False
Application.ActiveWorkbook.Save
If Workbooks.Count 1 Then
Application.ActiveWorkbook.Close
Else
Application.Quit
End If
Application.DisplayAlerts = True
End Sub



Checks to see if anyother workbooks are opend, if YSE then SAVES & Closes without Prompt.
If ONLY workbook opened, then SAVES & QUITS Excel withoput a prompt.

Corey....

"Shawn" wrote in message
...
What code should I use so that excel won't ask me to Save Changes? Where do
I put it?
--
Thanks
Shawn