Disable Save

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
0
Utf
5/20/2010 7:43:01 PM
excel.programming 6508 articles. 2 followers. Follow

5 Replies
788 Views

Similar Articles

[PageSpeed] 50

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
0
Utf
5/20/2010 7:50:01 PM
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
0
Utf
5/20/2010 8:09:01 PM
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
0
Dave
5/20/2010 8:12:30 PM
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
> .
> 
0
Utf
5/20/2010 8:53:01 PM
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
0
Dave
5/20/2010 10:27:19 PM
Reply:

Similar Artilces:

Outlook 2000 "save as" .MSG is not saving in message format??
All: We're trying to save individual messages from Outlook 2000 SR1 to message format (standard Internet RFC822 format) files. For most of last week it was working properly. File -> Save As, change file type to .MSG, and save the message, and it'd be RFC822-format text. Now, Outlook saves the message as a Word document. WTF? How do I get it to go back to the correct behavior, namely saving the message as an RFC822-format text file instead of a Word document? I'm not aware of anything having been changed, and this is happening on many users' systems. I don't see any...

Open and Save Files in Directory
I'd like to be able to select a directory and for each .xls file found in the directory 1) open the .xls file 2) write the name and date saved in another workbook (in this case "workbook report.xls") and 3) save and close the workbook. I have the shell of the loop but I'm missing the pieces where I've written comments. A solution for this would be greatly appreciated! Thanks. Sub OpenAndSaveFiles() Dim wkbk As Workbook Dim StrWkbk As String ' open a form that allows the user to select a directory i.e. C:\temp Workbooks("Workbook Report.xls&qu...

saving multiple sheets in a workbook
I have 1100 worksheets in a workbook all named after what I need to save them as, but I can't find any kind of "bulk save" where Excel can take each of the sheets and save them as individual files vs saving them all in a workbook. I don't want to click on "Save as" for each of the files, then manually enter the name of the worksheet, especially since there is no hotkey assigned to "save as". Does anyone know of a way around this? Or perhaps a shortcut for doing it? Hi Try http://www.rondebruin.nl/copy6.htm -- Regards Ron de Bruin http://www.ro...

Saving an excel file without it amending the name of file name
I enter new data in excel and when i save it it remaes itself by putting copy of infront of the name of the file. I use this on a daily basis so i will have lots of files called copy of and then when i save again its says copy of copy ...

cannot save email password
in setting up outlook i can enter the password and save it. however every time i exit outlook and logon again i have to re-enter the password. Any idea ? I'm not sure which version you are running, so I can't give you specifics, but here is the general idea. For instance, in outlook 2003, select tools, email accounts, view or change. Then select your mail account from the pop up and select change. There is an option in your mail account setup to enter your password. Be sure to click the "remember my password" button. It's similar in outlook 98 and outlook ...

disabling CTRL-Enter
I don't ever, ever want Outlook 2003 to send a message until I hit the "send" button. Is there a way of disabling the extremely annoying CTRL-Enter keyboard shortcut? Also, how do I disable the menu-abbreviating behavior? I already told Windows XP to not to use 'personalized menus', can I get Outlook to respecet my choice? TIA, Bob Bob wrote: > I don't ever, ever want Outlook 2003 to send a message until I hit the > "send" button. Is there a way of disabling the extremely annoying CTRL-Enter > keyboard shortcut? I do not believe you can disab...

How to remove ports that the Delete button is disabled
Hi All, I install Skype and noticed that it created more then 100 ports named Skype. Probably it happened during several installations. I uninstalled it and still the Delete button is disabled. How can I delete these ports under the Expectations tab? Thanks, Eric ...

saved as single page now need to convert to one large multiple pag
i have saved several individual pages as single files in publisher now i need to convert all of these individual saved files back into one multiple page document cut and paste does not work how do i do this please help kristy wrote: > i have saved several individual pages as single files in publisher > now i need to convert all of these individual saved files back into > one multiple page document cut and paste does not work how do i do > this please help ================= Which version of Publisher? Why doesn't copy/paste work? Maybe the following link will offer some ide...

CSV error when trying to save
I'm using Windows Vista X86 and Word 2007 and I'm trying to save a workbook in the CSV file format. Everytime I save, it gives an error saying the file name.csv may contain features that are not compatible with CSV (Comma delimited). I was wondering if I would lose data or if data would be corrupted because of this? Many Thanks Brandon G. It is not an error, it is a warning, just letting you know that the csv will contain plain text, no formatting, no formulas, etc. "Brandon G" wrote: > I'm using Windows Vista X86 and Word 2007 and I'm tryin...

Publisher, saving work, then opening in a different computer
I am new at this, but how can I save a project on one computer, then either save it on a disc or send as an email attachement that can then be opened on another computer that has Publisher on it and be able to conintue with changes, etc. You can email the file the same way you email any attachment. You can copy the file to a removable disk, the only caveat is before you open the file be certain to copy the file to the local hard drive. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "dave" <dave@discussions.microsoft....

picture saving
i want to add pictures in one of my tables in ms access .. is there any ay of doing that? Have a look at this link on "Displaying an Image in a Microsoft Access Form", it explain how to display a picture in a form (for future needs), but it also explain that it better to store the path to a picture and not the actual picture http://www.databasedev.co.uk/image-form.html -- Good Luck BS"D "Gurpreet Singh" wrote: > i want to add pictures in one of my tables in ms access .. > is there any ay of doing that? > It is always better to add a path to a pict...

Page setup setting not being saved
There appears to be a problem (at least with Access 2000) not saving the margins for a specific report - Any ideas ? Rob Any chance that the Tools | Options | (general tab) -- Track Name Autocorrect info is checked? That caused a know problem with report definitions in some versions of Access. Regards Jeff Boyce Microsoft Office/Access MVP "Rob" <robc1@yahoo.com> wrote in message news:3-qdneidKdx8ZjnbnZ2dnUVZ_jKdnZ2d@comcast.com... > There appears to be a problem (at least with Access 2000) not saving the > margins for a specific report - Any ideas ? > ...

why does the zip+4 get deleted when saving and excel file as a DBF
Each time I try to export, to dbf, an address list created in Excel it deletes the Zip+4 when in the xxxxx-xxxx format I need, Please help. In my simple test, the digits didn't get deleted, but the formatting was gone when I reopened the .dbf file in excel. If I typed in the zip+4 as text (preformat the cells as text or started with a leading apostrophe '12345-1234), then the text was kept in tact. KevinPlays wrote: > > Each time I try to export, to dbf, an address list created in Excel it > deletes the Zip+4 when in the xxxxx-xxxx format I need, Please help. -- Dave...

Want to reformat HD but save some of the e-mail from the inbox to new install..
So how do i do it..? >-----Original Message----- >So how do i do it..? >. > Best way is to export the files you need to a .PST file. Burn that off to a CD or copy it to a networked PC. Then import it after you are done the formatting. anonymous@discussions.microsoft.com wrote: >>-----Original Message----- >>So how do i do it..? >>. >> > > Best way is to export the files you need to a .PST file. > Burn that off to a CD or copy it to a networked PC. Then > import it after you are done the formatting. Couldn't I just copy the inbo...

Disable drag-n-drop on two Outlook View Controls
I have a public folder with a custom home page. On that home page are two Outlook view controls that point at two different ‘Contacts’ folders. I need to be able to do two things: 1. Disable drag and drop between the two controls 2. Disable drag and drop from either control to any other Contacts folder in the users’ folder structure. Has any one done this? Thanks in advance Priz (Outlook 2003) ...

Excel "save as" problem
Please help! All of a sudden, anytime I do a "save as" in excel, it hangs for abou 3 minutes. It then slowly proceeds to let me path to the correc folder. Any ideas? Mike horethm@bellsouth.ne -- mghorethPosted from - http://www.officehelp.i Two things I'd check............see if Excel is doing a Recalc before Save, and see if you have the Autofilter open on a large database...... Vaya con Dios, Chuck, CABGx3 "mghoreth" wrote: > > Please help! > > All of a sudden, anytime I do a "save as" in excel, it hangs for about > 3 minutes. ...

Why when i have more than one workbook open and i want to save ch.
When i want to close only one workbook all of them closes and then i have to reopen the ones i want Why? Hi at the top right of the screen do you see two X - the top one should close the application and all workbooks - the bottom one should close only the active workbook does this work for you? if not, does using File / Close from the menu work? Cheers JulieD "Jaykhi" <Jaykhi@discussions.microsoft.com> wrote in message news:6802A15F-D23B-4458-B1DE-8E56E3686B69@microsoft.com... > When i want to close only one workbook all of them closes and then i have > to > ...

Custom Level Button is Disabled
Hello: In Internet Explorer 7 on an XP workstation, the “Custom Level” button on the Security tab is grayed out--even when logged onto the machine as Administrator. How can this button get re-enabled? I need to re-enable it, in order to control some Business Portal settings. Thanks! childofthe1980s Child, This was an issue reported by many users with IE7 and IE6. Many users complain this might be due to some spyware programs installed on the PC or due to a bad upgrade from IE6 to IE7. I don't have definitive answers though. BTW, this error has nothing to do with your current...

auto save 12-05-07
I am not sure what happen but now when I open my database and start a new query I requires I save it. Instead of giving me the option to click no it only has the yes and cancel button available. Can someone help? On Dec 4, 8:06 pm, Sarah at DaVita <sarah.petter...@davita.com. (donotspam)> wrote: > I am not sure what happen but now when I open my database and start a new > query I requires I save it. Instead of giving me the option to click no it > only has the yes and cancel button available. Can someone help? Hi Sarah I had a similar problem recently with Access 2003. I...

Can't disable a feature
I'm trying to disable something in Excel 2004 for the Mac (I don't know if this also happens in Windows). On a spreadsheet, I use the abbreviation O/C (for On-Call if you must know). When I type this in a cell, it wants to change the "O/" part to what I will refer to as a "nordic O", the letter O with a slash through it. It appears to be a formatting thing, as the "O/C" is still shown in the formula bar if I click on the cell, but the display of it is being reformatted. I can't seem to disable this, and I don't find it under AutoCorrect anywhere...

saving default value for a text box
I'm using a text box for notes (it's not associated with any tables). When user entered some text there I'd like that this text would appear on the next time when user would open this form. I'm trying to use the following: Private Sub PrintHeaderText_AfterUpdate() Dim new_text As String new_text = Me.PrintHeaderText Me.PrintHeaderText.DefaultValue = "'" & new_text & "'" End Sub .... and the following code: Private Sub CloseButton_Click() DoCmd.Close acForm, Me.Form.Name, acSaveYes End Sub But when I open the form again ...

Picture occasionally saving as an attachment
Hi, I have pictures saved with all my contacts, the majority all seem fine, except now when I add a new contact and picture and view by the Phone List there is an icon in the Sort By: Attachment column for these new contacts. Can someone explain why this is happening and how to remove. Thanks Jason ...

Health Savings Account troubles
We have a Health Savings Account as part of our medical insurance plan. Employer contributes to the savings account and Employee has the option of participating in a tax deferred additional contribution. We set this up wrong. Employer contributions should be going to Code W on the W-2, but we have it set up so that Employee contributions (a deduction) are going to Code W. Does anyone else have this situation and how did you set up your HSA? These are fairly new and the way we set up was based on advice from a CPA. My W-2's are wrong - I also need to figure out how to correct the ...

Saving as fixed length file
If it can be done, can anyone tell me how to save an Excel file as a fixed length text file? Thanks, Tina You have a few choices (try against a copy of your worksheet): I'd either concatenate the cell values into another column: =LEFT(A1&REPT(" ",5),5) & LEFT(B1&REPT(" ",4),4) & TEXT(C1,"000,000.00") (You'll have to modify it to match what you want.) Then I'd copy and paste to notepad and save from there. Once I figured out that ugly formula, I kept it and just unhide that column when I wanted to export the data. If that doesn&...

saving a form as a page
Hi there I am trying to save a form as a page. I opened the form, click on save as and a box pops up that has the option to save as a form or a page. I selected page than I get an error code that states: "There was an error loading the XML data file'C:\Documents and Settings\Local Settings\Temporary Internet Files\content.MSO\3B68C570.temp. Please make sure that the file is a properly formatted XML file. A semi colon character was expected" Does anyone know the steps to rectify this? -- Thank-you! Ruth On Thu, 21 Feb 2008 05:23:01 -0800, Ruth <Ruth@discussions.mi...