Hi there,
See if the following code does what you need - it should be inserted in the "ThisWorkbook" VBA CodeModule:
Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True Then
MsgBox "You may not save a copy of this workbook", _
vbExclamation, " Invalid operation"
Cancel = True
Else: Cancel = False
End If
End Sub
Note that this code should be inserted into a workbook which has already been saved at least once, otherwise the warning message will be displayed.
Hope this helps.
Regards,
Greg M
Bookmarks