Consulting

Results 1 to 2 of 2

Thread: Can not get rid of "Do you want to Save changes"

  1. #1
    VBAX Newbie
    Joined
    Aug 2004
    Posts
    2
    Location

    Can not get rid of "Do you want to Save changes"

    Thanks in advance for helping.
    This is my code. Very simple. I want the user to be able to close without the option or message to save". I want to simply close with no option, i.e. click on close and go away

    [VBA] On Error GoTo 0
    Cells.Select
    Selection.Delete Shift:=xlUp
    Workbooks.Open Filename:="\\xxx\Public2\Manufacturing\PMJobs.xls"
    Range("Y3:Y3").Select
    Selection.AutoFilter
    End Sub
    Sub auto_close()
    ThisWorkbook.Saved = True
    ActiveWorkbook.Saved = True
    Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Application.DisplayAlerts = True
    ' Workbooks("PMJobs.XLS").Close SaveChanges:=False[/VBA]
    Last edited by Bob Phillips; 02-25-2013 at 09:17 AM. Reason: Added VBA tags

  2. #2
    VBAX Mentor
    Joined
    Apr 2009
    Location
    Kingsbury
    Posts
    423
    Location
    Try
    [VBA]
    Sub auto_close()
    ThisWorkbook.Save
    ActiveWorkbook.Save
    'Application.DisplayAlerts = False
    ActiveWorkbook.Close False
    'Application.DisplayAlerts = True
    ' Workbooks("PMJobs.XLS").Close SaveChanges:=False
    [/VBA]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •