SaveAsUI
Public Sub SaveAs()
Dim Filename As String
Msg = "Do you want to save the expense report?"
Ans = MsgBox(Msg, vbYesNo)
Select Case Ans
Case vbYes
Filename = InputBox("Enter File Name")
ActiveWorkbook.SaveAs Filename
Case vbNo
ActiveWorkbook.Close
End Select
End Sub
"Gun_Maddie" wrote in message
...
Here is the code that I have written, for some reason I am unable to
get the Save As dialog box to appear, the spreadsheet just saves and
closes. Any suggestions?
Private Sub Workbook_BeforeClose(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Msg = "Do you want to save the expense report?"
Ans = MsgBox(Msg, vbYesNo)
Select Case Ans
Case vbYes
ActiveWorkbook.SaveAs
Case vbNo
ActiveWorkbook.Close
End Select
End If
End Sub
|