save as error message

G

gavmer

Hi all,

I have a workbook that is to not be overwritten. It is basically
template to use for quoting. How do i avoid having the workboo
overwritten. Do i save as a template?? I would like possibly a promp
message before the user closes the book to ensure it isnt overwritten

IE: "Have you saved as a different name?"

How is this done??

Cheers all !!!!!
 
A

Auric__

Hi all,

I have a workbook that is to not be overwritten. It is basically a
template to use for quoting. How do i avoid having the workbook
overwritten. Do i save as a template??

Yes - that's what templates are for. Users do File -> New... (and not
just Ctrl+N) and a dialog pops up asking them what they want. They
select a template, and a copy of the template is loaded. (Maybe not
exactly how it happens, but that's the essence.)
I would like possibly a prompt
message before the user closes the book to ensure it isnt overwritten

IE: "Have you saved as a different name?"

How is this done??

In the VBA editor, under "ThisWorkbook":
Private Sub Workbook_BeforeClose(Cancel As Boolean)
tmp = MsgBox("Have you saved as a different name?", vbYesNo)
If Not (vbYes = tmp) Then Cancel = True
End Sub
 
P

Patrick Molloy

Several choices
1) is set the file READ-ONLY attribute to True in Explorer

2) trap the before -save event - see the earlier reply
which gives an example

Patrick Molloy
Microsoft Excel MVP
 
Top