Overriding the menu "Save" option?

  • Thread starter Thread starter Robert Crandal
  • Start date Start date
R

Robert Crandal

If my users click "Save", I need to stop them from actually
saving any changes to my workbook. I want my workbook
to be unchangeable, and if someone clicks "Save", I want
to call a separate subroutine which will write data to a separate
file.

Can anyone provide any help on over-riding the "Save"
option and making my workbook unchangeable??

thank you
 
One way:

Save your workbook as "Read Only" (Save As/Options/Read-only Recommended)

It's nearly impossible to make any solution foolproof, since fools are
so ingenious. You could use VBA to replace the Save command, but that
can be thwarted by opening with macros disabled. You can use VBA to make
it difficult to open the workbook without macros, but there's no
reliable way to prevent a reasonably savvy user from bypassing that.
 
I realize that no solution is foolproof.....

I am still interested in knowing about any of these ideas that are
foolproof. 8)

How can I intercept the menu "Save As" command?? Is the
solution related to the Workbook_BeforeSave() function???
 
Ooops, let me re-phrase that:

I am still interested in knowing about any of these ideas
that are NON-foolproof!

8)
 
I suggest you make the file read-only using Windows Explorer, instead of
saving it with read-only recommended. In Windows Explorer, right-click on the
(closed) workbook. Select Properties >> put a check in the 'read-only' box >>
OK. Unless your users reverse this procedure in Windows Explorer before
opening the workbook, they won't be able to save over it from Excel. Making
the file read-only also inhibits accidental deletion by requiring
confirmation first.

If you want to try Workbook_BeforeSave event code, it only needs to contain
the statement Cancel=True.

Hope this helps,

Hutch
 
Back
Top