ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   save as error message (https://www.excelbanter.com/excel-programming/300011-save-error-message.html)

gavmer[_28_]

save as error message
 
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 !!!!!

--
Message posted from http://www.ExcelForum.com


Auric__

save as error message
 
On Mon, 31 May 2004 22:11:39 -0500, gavmer
wrote:

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

--
auric underscore underscore at hotmail dot com
*****
No, you do not see. Pray you never will.

patrick molloy

save as error message
 
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


-----Original Message-----
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?? 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??

Cheers all !!!!!!


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 08:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com