ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable save & save as then return message... (https://www.excelbanter.com/excel-programming/372983-disable-save-save-then-return-message.html)

J.W. Aldridge

Disable save & save as then return message...
 
Hi.

I am looking for a way to either disable or delay a user from saving a
workbook.
I have a lot of people using the workbook and people keep saving it
with a similar name confusing other users as to which is the real
application.

So, I would like to create a message that says the following when they
attempt to choose 'save' or 'save as' from the file menu.

IT IS HIGHLY RECOMMENDED THAT YOU DO NOT SAVE THIS WORKBOOK. IF YOU
HAVE A PROBLEM OR WOULD LIKE TO SAVE YOUR WORK: (1)SELECT THE TAB OF
YOUR WORKSHEET (2) CHOOSE MOVE OR COPY (3) CREATE A COPY (4) UNDER 'TO
BOOK' CHOOSE NEW BOOK. ....THANKYOU.


Jim Thomlinson

Disable save & save as then return message...
 
You probably want something close to this...(place this in the Thisworkbook
module by right clicking the Excel Icon next to file in the Excel menu and
select view code)

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If MsgBox("Are you sure you want to save?", _
vbYesNo + vbQuestion, _
"Save?") = vbNo Then Cancel = True
End Sub

If you select yes then it saves. If you select no then it does not save.
--
HTH...

Jim Thomlinson


"J.W. Aldridge" wrote:

Hi.

I am looking for a way to either disable or delay a user from saving a
workbook.
I have a lot of people using the workbook and people keep saving it
with a similar name confusing other users as to which is the real
application.

So, I would like to create a message that says the following when they
attempt to choose 'save' or 'save as' from the file menu.

IT IS HIGHLY RECOMMENDED THAT YOU DO NOT SAVE THIS WORKBOOK. IF YOU
HAVE A PROBLEM OR WOULD LIKE TO SAVE YOUR WORK: (1)SELECT THE TAB OF
YOUR WORKSHEET (2) CHOOSE MOVE OR COPY (3) CREATE A COPY (4) UNDER 'TO
BOOK' CHOOSE NEW BOOK. ....THANKYOU.



NickHK[_3_]

Disable save & save as then return message...
 
As well as Jim's advice, you may want to incorporate you own warning into a
routine to make it more easy for the user.
Maybe using .SaveCopyAs .
Also, using a template would mean that the original is never open in the
first place, only a copy. If that is an option.

NickHK

"J.W. Aldridge"
roups.com...
Hi.

I am looking for a way to either disable or delay a user from saving a
workbook.
I have a lot of people using the workbook and people keep saving it
with a similar name confusing other users as to which is the real
application.

So, I would like to create a message that says the following when they
attempt to choose 'save' or 'save as' from the file menu.

IT IS HIGHLY RECOMMENDED THAT YOU DO NOT SAVE THIS WORKBOOK. IF YOU
HAVE A PROBLEM OR WOULD LIKE TO SAVE YOUR WORK: (1)SELECT THE TAB OF
YOUR WORKSHEET (2) CHOOSE MOVE OR COPY (3) CREATE A COPY (4) UNDER 'TO
BOOK' CHOOSE NEW BOOK. ....THANKYOU.





All times are GMT +1. The time now is 10:48 AM.

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