PLease test in a junk copy of your wb.

In ThisWorkbook Module:
[VBA]Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim wb As Workbook

If Not bolInProcess Then
'// Cancel the Close, set a Public flag and kill alerts in case a pre-existing //
'// wb/csv //
Cancel = True
bolInProcess = True
Application.DisplayAlerts = False
If Not ThisWorkbook.Saved Then
Select Case MsgBox(Me.Name & " is not saved." & vbCrLf & _
"Would you like to Save a backup and the file, save just the workbook," & vbCrLf & _
"or close without saving?" & vbCrLf & vbCrLf & _
"Select <Yes> to save a backup copy and the workbook, <No> to" & vbCrLf & _
"save just the workbook, or <Cancel> to close w/o saving.", _
vbYesNoCancel Or vbInformation, _
vbNullString)

Case vbYes
'// Save a copy to disk and open the copy. //
Me.SaveCopyAs Me.Path & "\New Folder\Temp.xls"
Set wb = Workbooks.Open(Me.Path & "\New Folder\Temp.xls")
'// Run procedure in copy, in order to set flag there. //
Application.Run wb.Name & "!Module1.Defeat"
'// Save the copy as a .csv and close it. //
wb.SaveAs Me.Path & "\New Folder\MyCSV.csv", xlCSV
wb.Close False
DoEvents
'// Kill the temp copy; save and close this wb. //
Kill Me.Path & "\New Folder\Temp.xls"
ThisWorkbook.Close True
Case vbNo
ThisWorkbook.Close True
Case vbCancel
ThisWorkbook.Close False
End Select
Else
If MsgBox("Would you like to save a backup copy?", vbYesNo Or vbQuestion, vbNullString) = vbYes Then

Me.SaveCopyAs Me.Path & "\New Folder\Temp.xls"
Set wb = Workbooks.Open(Me.Path & "\New Folder\Temp.xls")
Application.Run wb.Name & "!Module1.Defeat"
wb.SaveAs Me.Path & "\New Folder\MyCSV.csv", xlCSV
wb.Close False
DoEvents
Kill Me.Path & "\New Folder\Temp.xls"
ThisWorkbook.Close False
Else
ThisWorkbook.Close False
End If
End If
Application.DisplayAlerts = True
bolInProcess = False
End If
End Sub[/VBA]

In a Standard Module: (named Module1)
[VBA]Option Explicit

Public bolInProcess As Boolean

Sub Defeat()
bolInProcess = True
End Sub[/VBA]

Hope that helps,

Mark