I have the following code that I want to save data, save workbook, close workbook and quit the excel application. I think it is closing the workbook before it can execute the Application.Quit line. It is executed by a button.
1. What do I change to make it do what I want, i.e., to quit Excel AFTER closing????
2. Is the "ThisWorkbook.save" and "thisworkbook.close" the proper way to save and close (as opposed to "Activeworkbook.save" and "activeworkbook.close"????
3. Does the Application.Quit command automatically and correctly close the workbook???? Do you even need the "Thisworkbook.close" line?
thanks
Code:
Private Sub CommandButton4_Click()
Call SaveTextBoxData
ThisWorkbook.Save
MsgBox ("Your data has been saved."), vbInformation
ThisWorkbook.Close
Application.Quit
End Sub
1. What do I change to make it do what I want, i.e., to quit Excel AFTER closing????
2. Is the "ThisWorkbook.save" and "thisworkbook.close" the proper way to save and close (as opposed to "Activeworkbook.save" and "activeworkbook.close"????
3. Does the Application.Quit command automatically and correctly close the workbook???? Do you even need the "Thisworkbook.close" line?
thanks