ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving a Workbook (https://www.excelbanter.com/excel-programming/295171-saving-workbook.html)

JAmes L

Saving a Workbook
 
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

Frank Kabel

Saving a Workbook
 
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)


--
Regards
Frank Kabel
Frankfurt, Germany


JAmes L wrote:
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



patrick molloy

Saving a Workbook
 
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!

Thanks in advance,
James
.



All times are GMT +1. The time now is 12:11 PM.

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