I have a user interface in Excel where users will enter names and other information in text boxes and select options in combo boxes. I need for the information to be cleared upon closing even if the user selects save so the the next user who opens it will not see the previously entered information.
Right now I'm using the 'Private Sub Workbook_BeforeClose(Cancel As Boolean)' event function like this:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveSheet.OLEObjects("txtName").Object.Value = ""
ActiveSheet.OLEObjects("TextBox2").Object.Value = ""
ActiveSheet.OLEObjects("cboRegion").Object.Value = ""
ActiveSheet.OLEObjects("cboQuarter").Object.Value = ""
ActiveSheet.OLEObjects("cboDistrict").Object.Value = ""
End
This works BUT when I reopen the document I can still see the previously filled out information until I select enable macros, which then clears the information.
I thought using the BeforeClose Event would prevent this from happening .... Any suggestions for clearing more effectively before it reopens?
Bookmarks