PDA

View Full Version : How to create a macro to...



Esmatullah
12-11-2012, 10:55 PM
Hi dears!
Please send a macro when i exit my file don't show to me (Do you want to save your changes) just save it without showing any message. Thanks.

GTO
12-11-2012, 11:42 PM
I believe that is just a one-liner.

In the ThisWorkbook Module:
Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
End Sub

hope that helps,

Mark

Esmatullah
12-12-2012, 03:51 AM
Thanks dear i my problem was solved. But i have a msg box in this workbook module when insert this code and restart my file shows an error message and also i have a password for vba too

GTO
12-12-2012, 05:21 AM
I am afraid I am not understanding your reply at all. Please substitute non-sensitive but similar data for anything applicable, and attach an example file.