w/book saving problem

  • Thread starter tkraju via OfficeKB.com
  • Start date
T

tkraju via OfficeKB.com

My users uses a userform to enter data into w/book.but when that w/book
closes,its asking"Do you want to save the changes made to 'Book!.Xls'".,which
my users doesn,t want.
Whenever the userform closes or exits ,automatically it should save changes
without asking the question.
What code I should add to the userform to do the same?
 
J

JLGWhiz

Put this in the UserForm code module.

Private Sub UserForm_Deactivate()
ActiveWorkbook.Save
End Sub
 
T

tkraju via OfficeKB.com

even after putting this code,its still asking whether to save it or not?
Put this in the UserForm code module.

Private Sub UserForm_Deactivate()
ActiveWorkbook.Save
End Sub
My users uses a userform to enter data into w/book.but when that w/book
closes,its asking"Do you want to save the changes made to
[quoted text clipped - 4 lines]
without asking the question.
What code I should add to the userform to do the same?
 
J

JLGWhiz

The there is apparently some automation occuring after the UserForm closes
that the system is detecting. If the file has been saved to the User's
satisfaction at the time they want to close the workbook, then in the
workbook close statement, add
SaveChanges:=False, like this:

ActiveWorkbook.Close SaveChanges:=False

tkraju via OfficeKB.com said:
even after putting this code,its still asking whether to save it or not?
Put this in the UserForm code module.

Private Sub UserForm_Deactivate()
ActiveWorkbook.Save
End Sub
My users uses a userform to enter data into w/book.but when that w/book
closes,its asking"Do you want to save the changes made to
[quoted text clipped - 4 lines]
without asking the question.
What code I should add to the userform to do the same?
 
Top