Hello,
I know this one is going to sound simple but I'm trying to get a workbook to close without it asking whether it wants the user to save changes. This is the code I've used so far but it doesn't seem to work:
If Workbook("Candidate Tracking").Saved = False Then
Workbook("Candidate Tracking").Close SaveChanges:=False
End If
VBA: Closing a Workbook
-
-
-
If Workbook("Candidate Tracking").Saved = False Then
Workbook("Candidate Tracking").Close SaveChanges:=False....change Workbook to Workbooks
If Workbooks("Candidate Tracking").Saved = False Then
Workbooks("Candidate Tracking").Close SaveChanges:=FalseNot sure why you need an if statement though. If it isn't saved then close without saving. If it is saved then don't close?
Workbooks("Candidate Tracking").Close SaveChanges:=False
....can stand on it's own. -
Egad,
Thanks. I thought it was probably something I overlooked. The reason we want it done this way is because we don't want the enduser to save anything when they close. It is a shared document and we'd rather just have them use it and close it than try to save anything to it.
Thanks for your input.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!