johnwayne
06-16-2008, 03:00 PM
I am using a macro which creates a new workbook and want this workbook to not ask to save when it is later closed by the user. I have done this previously by writing the following sub into the Workbook code area:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub
However, I can't find any way to write this macro into the new workbook I create, or basically create a macro using a macro.
Anyone know how to do this, or another way to prevent it from asking to save?
thanks.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub
However, I can't find any way to write this macro into the new workbook I create, or basically create a macro using a macro.
Anyone know how to do this, or another way to prevent it from asking to save?
thanks.