ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   w/book saving problem (https://www.excelbanter.com/excel-programming/427139-w-book-saving-problem.html)

tkraju via OfficeKB.com

w/book saving problem
 
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?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200904/1


JLGWhiz[_2_]

w/book saving problem
 
Put this in the UserForm code module.

Private Sub UserForm_Deactivate()
ActiveWorkbook.Save
End Sub



"tkraju via OfficeKB.com" <u16627@uwe wrote in message
news:94cd1334acc23@uwe...
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?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200904/1




tkraju via OfficeKB.com

w/book saving problem
 
even after putting this code,its still asking whether to save it or not?

JLGWhiz wrote:
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?


--
Message posted via http://www.officekb.com


JLGWhiz

w/book saving problem
 
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" wrote:

even after putting this code,its still asking whether to save it or not?

JLGWhiz wrote:
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?


--
Message posted via http://www.officekb.com




All times are GMT +1. The time now is 11:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com