Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim Name As String Dim Answer As Variant Answer = MsgBox("Unlink and Save (Yes), Save As Is (No), Don't Save (Cancel)", vbYesNoCancel) If Answer = vbNo Then 'Let the Workbook do the work Exit Sub ElseIf Answer = vbCancel Then 'Don't Save Cancel = True Exit Sub Else 'This sub will do the saving Cancel = True Name = Application.GetSaveAsFilename 'If the user Cancels at this time If Name = False Then Exit Sub Unlink_Data Me.SaveAs Name End If End Sub




Reply With Quote