View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default 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.