I have a save changes button in a worksheet with the following code:
Sub Save_Changes()
ActiveWorkbook.Save
End Sub
I am trying to disable the save as changes by using the following code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True Then
MsgBox "Please use the [Save Changes] button to Save this Workbook.", vbCritical
Cancel = True
End If
End Sub
The message box "Please use the [Save Changes] button to Save this Workbook." seems to appear when I click on my save changes button on the worksheet.
Background: I am developing a workbook where the user has no choice but to click on the save changes button on the worksheets and/or the workbook will save automatically on closure. I would like to disable the save as from the file menu and the save button on the standard toolbar.
Your assistance would be greatly appreciated.
Sub Save_Changes()
ActiveWorkbook.Save
End Sub
I am trying to disable the save as changes by using the following code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True Then
MsgBox "Please use the [Save Changes] button to Save this Workbook.", vbCritical
Cancel = True
End If
End Sub
The message box "Please use the [Save Changes] button to Save this Workbook." seems to appear when I click on my save changes button on the worksheet.
Background: I am developing a workbook where the user has no choice but to click on the save changes button on the worksheets and/or the workbook will save automatically on closure. I would like to disable the save as from the file menu and the save button on the standard toolbar.
Your assistance would be greatly appreciated.