+ Reply to Thread
Results 1 to 13 of 13

Disable Save As Function

  1. #1
    Registered User
    Join Date
    07-21-2004
    MS-Off Ver
    2010
    Posts
    51

    Disable Save As Function

    I'm using the following code in "ThisWorkBook" but every time I try to test & click on Save As - it allows me to save - why is this not working?

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    MsgBox "The 'Save As' Function has been disabled"
    Cancel = True 'Cancels any request to save the file
    End Sub

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Save As Function

    Where have you placed this code?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    07-21-2004
    MS-Off Ver
    2010
    Posts
    51

    Re: Disable Save As Function

    in the Visual Basic "ThisWorkbook"
    Attached Images Attached Images

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Save As Function

    Strange, works fine here.
    The moment I press the Save or SaveAs button I get the message box
    Here's a link with some ideas
    https://www.extendoffice.com/documen...llow-save.html
    and this code will do it too

    Please Login or Register  to view this content.
    You will have to enable those command before ending the session

  5. #5
    Registered User
    Join Date
    07-21-2004
    MS-Off Ver
    2010
    Posts
    51

    Re: Disable Save As Function

    I do have a couple of control boxes that I have macros assigned to in order pull items into & clear off form & in those macros it unprotects & reprotects the sheet.
    seems like after these buttons are used then the "Save As" function is available again - would these buttons be causing an issue from the unprotecting & reprotecting sheet?

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Save As Function

    Well, have you re-read your answer to my question?
    You say yourself that you have a couple of control boxes (all macro's then) and you want me (and the readers) to try and 'guess' if this is possible? How do you want us to guess if we don't even know what they do.
    Think it over and explain more, guessing and assumptions are no options for helping someone.

  7. #7
    Registered User
    Join Date
    07-21-2004
    MS-Off Ver
    2010
    Posts
    51

    Re: Disable Save As Function

    my apologies - I will close out the thread until I can provide better information.

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Save As Function

    Not necessary to apologize, it's just that your information does not tell us everything.

  9. #9
    Registered User
    Join Date
    07-21-2004
    MS-Off Ver
    2010
    Posts
    51

    Re: Disable Save As Function

    Using the following code in VBA "ThisWorkbook" to try & disable the Save & Save As functions - but this is not working properly

    Private Sub Workbook_Open()
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save As...").Enabled = False
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save").Enabled = False
    End Sub

    Attached is spreadsheet I'm using & wanting to prevent the Saving Function - also contains VBA for emailing form

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Save As Function

    Hi, sorry for not answering but haven’t had the time ,
    Will look later today and let you know

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Save As Function

    Try this, you can only save the file using the button on the sheet.
    You can decide and add a prompt for a password or only allow certain people to save the file.
    Now all save options are disabled.

  12. #12
    Registered User
    Join Date
    07-21-2004
    MS-Off Ver
    2010
    Posts
    51

    Re: Disable Save As Function

    We really don't want anyone to be able to save the file except me as administrator of the file.
    I add / delete info from another sheet not shown in the attached example - then I save file & upload to a server for others to use - we just don't want them to be able to save the file to their desktop or anything - this way they have to go to the server & use the most recent updated file that I uploaded.

  13. #13
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Save As Function

    Well, then you delete the button and there is nothing they can do.
    This also mean that YOU cannot save it either.
    You could use a prompt for a password to allow to save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Disable Workbook Save Function
    By Sampascale in forum Excel General
    Replies: 1
    Last Post: 08-07-2013, 11:58 AM
  2. Disable Workbook Save Function
    By Sampascale in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2013, 10:33 AM
  3. Disable save function for users
    By Barry Engelbrecht in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-09-2013, 09:36 AM
  4. [SOLVED] Can I disable 'Save' function in excel?
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-05-2013, 06:13 AM
  5. disable save & send function
    By wetph00t in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 04:24 PM
  6. Disable save function
    By JB in forum Excel General
    Replies: 3
    Last Post: 05-26-2005, 05:15 PM
  7. Disable save Function
    By JB in forum Excel General
    Replies: 1
    Last Post: 05-25-2005, 05:06 PM
  8. Remove or Disable the Save Function and Keep the Save As
    By topkick in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-23-2005, 08:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1