You could do this by setting a flag within your ShutDown procedure and then executing the code or not in the BeforeClose procedure depending on the flag's value. For example, place this in module 1, note that the declaration of blFlag must be outside of any procedures: -
Code:
Public blFlag As Boolean
Public Sub ShutDown()
blFlag = True
ActiveWorkbook.Close
End Sub
So, when you run your Shutdown procedure, the flag is set to True. Now, amend your BeforeClose procedure similar to the following: -
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not blFlag Then
' your code
End If
End Sub
Now your BeforeClose code will only run if the flag is False and will be ignored if your ShutDown procedure is run first.