Forcing Save Macro

  • Thread starter Thread starter alex richardson
  • Start date Start date
A

alex richardson

How can I force users to save via a macro which strips
away sensitive data before saving? Don't want them to be
able to use SAVE or SAVE AS to save the entire
spreadsheet. Making it read-only doesn't work, because it
allow users to save under a different name.
 
Hi
you can put some code in the BeforeSave event but this won't help if
the user simply disables macros
 
Apologies to you Alex, I mistakenly sent this you personally, this is a
copy,

To give you a start, this will prevent saving

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Cancel = True
End Sub

To save the file once you've done this

Sub Saver ()
Application.EnableEvents = False
'Your code to remove sensitive data
ThisWorkbook.Save
Application.EnableEvents = True
End Sub

Bear in mind that if someone opens the file with macros disabled they can do
as they wish. You can use code to prevent the workbook from being opened
with macros disabled, but Excel security is easily overcome by anyone with a
little knowledge.

Regards,

----- Original Message -----
From: "alex richardson" <[email protected]>
Newsgroups: microsoft.public.excel.misc
Sent: Friday, August 06, 2004 7:21 PM
Subject: Forcing Save Macro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top