View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Workbook_BeforeSave question

Hi Barb

You can use this

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then
'do nothing
Else
Cancel = True
End If
End Sub

But if you use save as to another name the code is also working
Maybe add a check for the template name


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Barb Reinhardt" wrote in message
...
Does it make sense to force a SAVEAS during the workbook_beforesave event?
We have a "template" (not in the Excel terminology) that we don't want
overwritten. Is there a recommended way to ensure that doesn't happen with
the Workbook_beforesave or another method?

Thanks,