VBA workbooks.Close without being prompted to if the user wants to save?

Try using ThisWorkbook.Saved = True

        Application.DisplayAlerts = False
        currentBook.SaveAs Filename:=fileNameS, FileFormat:=xlCSV, ConflictResolution:=xlLocalSessionChanges
        currentBook.Saved = True            
        currentBook.Close SaveChanges:=False
        Application.DisplayAlerts = True

This is what I have done in the past and it's worked for me:

Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Filename:=fileNameS, FileFormat:=xlCSV, conflictResolution:=xlLocalSessionChanges
Application.DisplayAlerts = True
ActiveWorkbook.Close False

You can also try putting the Close before the DisplayAlerts is reset to true...

Tags:

Excel

Vba