Saving a Workbook

J

JAmes L

Hello

Is it possible to open a new workbook and make it impossible for the user to save the new workbook. Also let them know that they can't save it

Thanks in advance
James
 
F

Frank Kabel

Hi
you could use the BeforeSave event of your workbook for this (note:
this is not totally bullet proof. e.g. the user disables macros).
Put the following code in your workbook module:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
msgbox "Saving not allowed"
Cancel = True
End Sub

Or just create the workbook as readonly (protect this with a password)
 
P

Patrick Molloy

There's no bullet proof way to stop a user saving an
excel workbook. For example they could open it with
macros disabled ... so any event driven code would not
work.

What we do is give the user a shortcut to the excel
workbook and then write protect the workbook. This
prevents the user from writing over the "production" copy
of the workbook while it doesn't prevent them saving a
copy with a different name

HTH

Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
Hello,

Is it possible to open a new workbook and make it
impossible for the user to save the new workbook. Also
let them know that they can't save it!
 
Top