auto close in Excel 2007
You could try...
sub CloseMe
with thisworkbook
.saved = true ' use this to discard any changes
.save ' use this to save any changes without prompting
'and use neither if you want to be prompted in the normal way
.close
end with
end sub
change thisworkbook to activeworkbook if you want it close whichever is
active at the time, and don't forget to save the book as a macro-enabled
workbook - but you knew that
M
On Wed, 26 Nov 2008 09:43:01 -0800, jim wrote:
I have the following code to auto close the workbook, but it does not work.
Any suggestions? Thanks for any assistance.
Sub Auto_Close()
'
' Auto_Close Macro
'
With ActiveWorkbook
.RunAutoMacros xlAutoClose
.Close
End With
'
End Sub
|