Consulting

Results 1 to 4 of 4

Thread: Read Only file - Stop from asking for Save

  1. #1
    VBAX Regular
    Joined
    Jan 2009
    Posts
    57
    Location

    Read Only file - Stop from asking for Save

    I have a file that has userforms to create other files ot open them. It also contains data.

    I don't want to allow other users to share the workbook because I don't want them to be able to update the data.

    Without Workbook Sharing they are still able to use the application to open the other files from this original file it's just that they have to use it in Read Only mode.

    The problem is that when they come to close the file they are asked if they want to save a copy. I want the answer always to be NO.

    Is there a way with code to achieve what I want please?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    in code

    [vba]

    Activeworkbook.Close SaveChanges:=False
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Yes ad this to the Thisworkbook module[VBA]Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ThisWorkbook.Saved = True
    End Sub[/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  4. #4
    VBAX Regular
    Joined
    Jan 2009
    Posts
    57
    Location
    Thanks guys will try them out soon to see which best fits what I want.

Posting Permissions

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