+ Reply to Thread
Results 1 to 8 of 8

Prevent Save, enable SaveAs with default file name

Hybrid View

  1. #1
    Registered User
    Join Date
    01-15-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    5
    hello shg,

    1. What keeps the user from using the SaveAs dialog to save over the original file? Why not just make the file read-only?

    Yes good idea, I will make it read-only. I would still like to have the message box appear if a user clicks save.

    2. Once the user does a SaveAs to another filename, they are still precluded from doing a Save. Is that your intent?

    This is exactly my problem. I would like the user to be able to save the file if they go through SaveAs, but not if they go through Save. Thank you.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Quote Originally Posted by shg
    2. Once the user does a SaveAs to another filename, they are still precluded from doing a Save. Is that your intent?
    This is exactly my problem. I would like the user to be able to save the file if they go through SaveAs, but not if they go through Save. Thank you.
    So -- the file is named "Bob". I dutifully save the file as "Joe". After that, I'm still not allowed to just press Save to resave "Joe"?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-15-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    5
    Hello shg:

    So -- the file is named "Bob". I dutifully save the file as "Joe". After that, I'm still not allowed to just press Save to resave "Joe"?

    If this was possible, that would be great. The process would then be:
    1. Open Bob
    2. If save Bob, not allowed
    3. If save as Joe, allowed
    4. If save Joe, allowed
    Thank you!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
        If ThisWorkbook.ReadOnly And Not SaveAsUI Then
            MsgBox "This file is read-only. Please use File > SaveAs."
            Cancel = True
        End If
    End Sub

  5. #5
    Registered User
    Join Date
    11-04-2013
    Location
    Spartanburg, SC
    MS-Off Ver
    Excel 2013
    Posts
    1

    Re: Prevent Save, enable SaveAs with default file name

    Dora,
    I ran across this thread and it looks like what I am trying to accomplish with my spreadsheet. Did you ever get this resolved and if so what was the code you used?

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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