• Disable Save (Excel)

    Author
    Topic
    #382778

    I benefitted from your help recently. Now I need more. The following code recommended by Andrew works great to disable the “Save As” in a template. However, it does not disable the “Save”. Is there a way to do this, too? Thanks
    –cat (see post 211341)

    Andrew wrote earlier:

    When saving the template set a password to modify and recommend Read-Only. That should enable password holders only (yourself) amend the document but prevent saving by others.

    To disbale SaveAs include the following code in the ThisworkBook module :

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If SaveAsUI = True Then Cancel = True End IfEnd SubAlso include the following to prevent Excel prompting to save when the workbook is closed :

    Private Sub Workbook_BeforeClose(Cancel As Boolean) Me.Saved = TrueEnd SubAndrew C

    Viewing 0 reply threads
    Author
    Replies
    • #650089

      Now you need to take out the test of SaveAsUI as True (User is going through SaveAs), or False (user is going through Save or Ctrl-S). It should be as simple as:

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

    Viewing 0 reply threads
    Reply To: Disable Save (Excel)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: