Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jun 2002
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Disable Save (Excel)

    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

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Disable Save (Excel)

    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
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Lounger
    Join Date
    Jun 2002
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disable Save (Excel)

    Thanks!!! That was it!
    --cat

Posting Permissions

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