Greetings!
I'm facing a force close when saving a workbook with this code
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim bFileSaveAs As Boolean
If ActiveWorkbook.Name Like "Template*" Then
bFileSaveAs = Application.Dialogs(xlDialogSaveAs).Show
On Error Resume Next
If Not bFileSaveAs Then MsgBox "Remember, save Report generated in a different archive if it is the first time", vbExclamation, "Leave template clean for use"
End If
End Sub
I want to keep the template clean and let the user only save copies -when trying to save-
It's a macro enabled workbook, I want them to be available to run the macros but when they try to save only let them save in a new workbook.
This code kind of does the trick, however, when it saves the workbook excel stops working.
Bookmarks