save changes on close using vba

G

Guest

Hi All,

How can i programmatically save all changes made in a workbook, such that MS
Excel doesn't prompt the user before they close the workbook?
 
G

Guest

hi
in a thisworkbook module, paste this.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub
everytime someone closes the file excel will save it whether it needs saving
or not.

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top