letswriteafairytale
New Member
- Joined
- Dec 23, 2024
- Messages
- 16
- Office Version
- 365
- Platform
- Windows
I have a VBA that works ALMOST how I want it to work.
The code below works, only thing is, after saving the file ANOTHER save as dialog box opens. I don't want a second save as dialog box to pop up AFTER the file has already been saved in whatever file type they picked.
The code below works, only thing is, after saving the file ANOTHER save as dialog box opens. I don't want a second save as dialog box to pop up AFTER the file has already been saved in whatever file type they picked.
VBA Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim MsgResult As Integer
MsgResult = MsgBox("Please use the 'SAVE PROPOSAL' button at the top of the bid proposal. Click OK to return to the bid proposal. Click CANCEL to save as a different file type", _
vbOKCancel, "STOP! This workbook needs to be saved as a Macro-Enabled workbook.")
Select Case MsgResult
Case vbOK
Cancel = True
Case vbCancel
With Application.FileDialog(msoFileDialogSaveAs)
.FilterIndex = 2
If .Show Then
ActiveWorkbook.SaveAs filename:=.SelectedItems(1), _
FileFormat:=xlOpenXMLWorkbookMacroEnabled
End If
End With
End Select
End Sub