+ Reply to Thread
Results 1 to 4 of 4

Prevent anyone "Saving" a shared workbook

  1. #1
    Forum Contributor
    Join Date
    10-03-2016
    Location
    Sydney, Australia
    MS-Off Ver
    MS 365
    Posts
    128

    Prevent anyone "Saving" a shared workbook

    This is a funny one, not sure if it can be done.

    Firstly, I have a shared workbook used by my colleagues. The file is only used for reference, not to be edited by my colleagues, only I can edit it from the original file (which can only be done if all the shared books are closed).

    Now, unfortunately some of my colleagues go and search for an item then press "Save", doing this causes the workbook to save on the item they had been searching for.

    Is there a way to prevent this from happening so that each time the workbook is opened, it always goes to a default layout?

    (Now, before any one mentions that I should not share the file and make it "Read Only", unfortunately the staff I work with are much much older and not technological, so when they see the dialog box stating it is read only, they assume something is wrong and exit the workbook, even though I have mentioned time and again that they only need to click on 'Read Only'. A shared workbook does not come up with this error message.)

    Thanks

  2. #2
    Registered User
    Join Date
    04-11-2016
    Location
    Daventry, England
    MS-Off Ver
    2016
    Posts
    24

    Re: Prevent anyone "Saving" a shared workbook

    Hi

    Since it's only for reference, how about you saving file as a PDF for others to use? Otherwise your network administrator should be able to give users Read access only.

    Regards
    Alan

  3. #3
    Registered User
    Join Date
    06-24-2016
    Location
    Slovakia
    MS-Off Ver
    MS Office 365
    Posts
    92

    Re: Prevent anyone "Saving" a shared workbook

    Hi Anarchus,
    You can ask for password if someone want to save your file. This can be done using VBA event

    VBA Code (click alt+F11 and add below code to ThisWorkbook section):

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Dim Password As String
    Password = InputBox("Input your password")
    If Not Password = "1234" Then
    Cancel = True
    MsgBox "You can't save this workbook!"
    End If
    End Sub


    There is password set to 1234, you can change it in that code to whatever you want, but anyone who access VBA editor can see that if you don't protect it as well

    You can try it in attached blank file with this code.. just make some change and try to save it.
    Hope this helps.
    Attached Files Attached Files
    Have a fantastic day

  4. #4
    Forum Contributor
    Join Date
    10-03-2016
    Location
    Sydney, Australia
    MS-Off Ver
    MS 365
    Posts
    128

    Re: Prevent anyone "Saving" a shared workbook

    Thanks A.Clubb for the reply, I should have mentioned that there is a search formula for a large database in the file, so a PDF file wouldn't work.

    Excelko, I'm not able to test the password out yet but it looks like something very useful I could use and would resolve my issue, thanks so much!

+ 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. Replies: 1
    Last Post: 05-23-2013, 02:04 PM
  2. Import "|" delimitted files into workbook - Saving that workbook (determine path)
    By schmidt1962 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2013, 11:28 AM
  3. [SOLVED] Excel VBA - Handling file contention on "shared" workbook
    By TMS in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-18-2013, 04:37 PM
  4. Replies: 1
    Last Post: 06-21-2012, 06:21 AM
  5. Replies: 1
    Last Post: 03-18-2012, 11:09 PM
  6. "Project is unviewable" when closing a shared workbook
    By JoshP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2007, 12:57 PM
  7. Replies: 0
    Last Post: 09-08-2005, 09:05 AM
  8. [SOLVED] Prevent Excel closing all workbook instances when clicking on "X"
    By Deeptech-NM in forum Excel General
    Replies: 8
    Last Post: 07-04-2005, 09:05 AM

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