PC Review


Reply
Thread Tools Rate Thread

Disable Save

 
 
terilad
Guest
Posts: n/a
 
      20th May 2010
Hi,

I am looking for some help with a macro, I need to disable anyone from
saving a file or save as and also disable the prompt if the close button is
pressed you get an option to save the file then, I need to disable all of
these, also have a pop up box to warn that save as been disables when a user
tries to save the file fro save and save as.

Can anyone help mw with this.

Regards

Mark
 
Reply With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      20th May 2010
If you disable save on SaveAs, Save and Close, how is the user to save the
file, with magic? Help me here.

Barb Reinhardt



"terilad" wrote:

> Hi,
>
> I am looking for some help with a macro, I need to disable anyone from
> saving a file or save as and also disable the prompt if the close button is
> pressed you get an option to save the file then, I need to disable all of
> these, also have a pop up box to warn that save as been disables when a user
> tries to save the file fro save and save as.
>
> Can anyone help mw with this.
>
> Regards
>
> Mark

 
Reply With Quote
 
terilad
Guest
Posts: n/a
 
      20th May 2010
I do not want the user to save the file as it is a protected document and for
redistribution.

Mark

"Barb Reinhardt" wrote:

> If you disable save on SaveAs, Save and Close, how is the user to save the
> file, with magic? Help me here.
>
> Barb Reinhardt
>
>
>
> "terilad" wrote:
>
> > Hi,
> >
> > I am looking for some help with a macro, I need to disable anyone from
> > saving a file or save as and also disable the prompt if the close button is
> > pressed you get an option to save the file then, I need to disable all of
> > these, also have a pop up box to warn that save as been disables when a user
> > tries to save the file fro save and save as.
> >
> > Can anyone help mw with this.
> >
> > Regards
> >
> > Mark

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      20th May 2010
There's really no good way to stop the user from saving the file. If the user
disables macros, then no macro will stop them from saving.

And they could even use windows explorer to copy the file to a new location.

But if the user allows macros to run, you can tie into some workbook events.

This kind of code would go into the ThisWorkbook module:

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Saved = True 'a white lie!
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
MsgBox "You can't save this file!"
End Sub
Private Sub Workbook_Open()
MsgBox "You can't save this file!"
End Sub

=======
If you don't want them to overwrite your original file, then you may want to ask
your IT folks to create a common network share that only you (and a few trusted
co-workers) have read/write access to.

Everyone else would have read-only access.

=======

And after you make changes, you'll want to save them.

So open the VBE
hit ctrl-g to see the immediate window
type:
application.enableevents = false
and hit enter.

Then back to excel to save your workbook with your changes.

Then back to the VBE's immediate window and type:
application.enableevents = true
and hit enter

Be aware that this procedure can be done by anyone -- not just you.



terilad wrote:
>
> Hi,
>
> I am looking for some help with a macro, I need to disable anyone from
> saving a file or save as and also disable the prompt if the close button is
> pressed you get an option to save the file then, I need to disable all of
> these, also have a pop up box to warn that save as been disables when a user
> tries to save the file fro save and save as.
>
> Can anyone help mw with this.
>
> Regards
>
> Mark


--

Dave Peterson
 
Reply With Quote
 
terilad
Guest
Posts: n/a
 
      20th May 2010
Hi Dave,

Thanks for your reply, this is a word document, how will i edit this code
for word and where to input the code?

Regards

Mark

"Dave Peterson" wrote:

> There's really no good way to stop the user from saving the file. If the user
> disables macros, then no macro will stop them from saving.
>
> And they could even use windows explorer to copy the file to a new location.
>
> But if the user allows macros to run, you can tie into some workbook events.
>
> This kind of code would go into the ThisWorkbook module:
>
> Option Explicit
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
> Me.Saved = True 'a white lie!
> End Sub
> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
> Cancel = True
> MsgBox "You can't save this file!"
> End Sub
> Private Sub Workbook_Open()
> MsgBox "You can't save this file!"
> End Sub
>
> =======
> If you don't want them to overwrite your original file, then you may want to ask
> your IT folks to create a common network share that only you (and a few trusted
> co-workers) have read/write access to.
>
> Everyone else would have read-only access.
>
> =======
>
> And after you make changes, you'll want to save them.
>
> So open the VBE
> hit ctrl-g to see the immediate window
> type:
> application.enableevents = false
> and hit enter.
>
> Then back to excel to save your workbook with your changes.
>
> Then back to the VBE's immediate window and type:
> application.enableevents = true
> and hit enter
>
> Be aware that this procedure can be done by anyone -- not just you.
>
>
>
> terilad wrote:
> >
> > Hi,
> >
> > I am looking for some help with a macro, I need to disable anyone from
> > saving a file or save as and also disable the prompt if the close button is
> > pressed you get an option to save the file then, I need to disable all of
> > these, also have a pop up box to warn that save as been disables when a user
> > tries to save the file fro save and save as.
> >
> > Can anyone help mw with this.
> >
> > Regards
> >
> > Mark

>
> --
>
> Dave Peterson
> .
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      20th May 2010
I don't know.

You should ask in one of the forums dedicated to MSWord.

Remember to tell them what version of MSWord you're using.



terilad wrote:
>
> Hi Dave,
>
> Thanks for your reply, this is a word document, how will i edit this code
> for word and where to input the code?
>
> Regards
>
> Mark
>
> "Dave Peterson" wrote:
>
> > There's really no good way to stop the user from saving the file. If the user
> > disables macros, then no macro will stop them from saving.
> >
> > And they could even use windows explorer to copy the file to a new location.
> >
> > But if the user allows macros to run, you can tie into some workbook events.
> >
> > This kind of code would go into the ThisWorkbook module:
> >
> > Option Explicit
> > Private Sub Workbook_BeforeClose(Cancel As Boolean)
> > Me.Saved = True 'a white lie!
> > End Sub
> > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
> > Cancel = True
> > MsgBox "You can't save this file!"
> > End Sub
> > Private Sub Workbook_Open()
> > MsgBox "You can't save this file!"
> > End Sub
> >
> > =======
> > If you don't want them to overwrite your original file, then you may want to ask
> > your IT folks to create a common network share that only you (and a few trusted
> > co-workers) have read/write access to.
> >
> > Everyone else would have read-only access.
> >
> > =======
> >
> > And after you make changes, you'll want to save them.
> >
> > So open the VBE
> > hit ctrl-g to see the immediate window
> > type:
> > application.enableevents = false
> > and hit enter.
> >
> > Then back to excel to save your workbook with your changes.
> >
> > Then back to the VBE's immediate window and type:
> > application.enableevents = true
> > and hit enter
> >
> > Be aware that this procedure can be done by anyone -- not just you.
> >
> >
> >
> > terilad wrote:
> > >
> > > Hi,
> > >
> > > I am looking for some help with a macro, I need to disable anyone from
> > > saving a file or save as and also disable the prompt if the close button is
> > > pressed you get an option to save the file then, I need to disable all of
> > > these, also have a pop up box to warn that save as been disables when a user
> > > tries to save the file fro save and save as.
> > >
> > > Can anyone help mw with this.
> > >
> > > Regards
> > >
> > > Mark

> >
> > --
> >
> > Dave Peterson
> > .
> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Save, Save As function in emails - Outlook 2003 lesteryeo@gmail.com Microsoft Outlook 5 27th Oct 2007 06:20 PM
Disable save & save as then return message... J.W. Aldridge Microsoft Excel Programming 2 15th Sep 2006 04:35 PM
disable save and saveas from menubar and save via command button =?Utf-8?B?U3RldmUgRQ==?= Microsoft Excel Programming 5 13th Sep 2006 11:51 PM
Disable save, save as, but allow save via command button =?Utf-8?B?VGltTg==?= Microsoft Excel Programming 10 1st Sep 2006 07:05 PM
redirect or disable save button or file>save Microsoft Outlook VBA Programming 6 11th Mar 2004 03:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 PM.