+ Reply to Thread
Results 1 to 6 of 6

Prevent saving

  1. #1
    Registered User
    Join Date
    06-26-2011
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2003
    Posts
    40

    Prevent saving

    When a user exist my workbook, they're prompted to save each time. I don't want them to be prompted; the workbook should never be saved. How can I prevent the message, and how can I disable the File/Save menu option?

  2. #2
    Registered User
    Join Date
    06-29-2011
    Location
    California
    MS-Off Ver
    Excel 2003/2007
    Posts
    58

    Re: Prevent saving

    If you search the forums, or even google, this can be found quite easily...

    In the future try to do so first, otherwise put this code in your 'ThisWorkbook' module (push alt+f11 to pull open your vba editor, double clik 'thisworkbook' and copy/paste the following code, then save the workbook - follow these steps and you will no longer be prompted to save).

    Please Login or Register  to view this content.
    You can disable the file save menu by exploring the commandbars feature...

    You could do something like...

    Please Login or Register  to view this content.
    Last edited by docMed; 07-11-2011 at 01:12 AM.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Prevent saving

    You can't prevent them saving. All they need to do is open without enabling macros.

    Disabling a commandbar on opening will require it to be restored on closing.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    06-29-2011
    Location
    California
    MS-Off Ver
    Excel 2003/2007
    Posts
    58

    Re: Prevent saving

    Well, it sounds like the workbooks simply being used to either calculate temporary values, or be viewed for constant information - in this case, just set the workbook to read only, which will work around your source file being accidentally saved at least. And yes, you can disable the commandbar and enable it upon closing if you desire so.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Prevent saving

    You can 'prevent saving' using the workbook as an AddIn.

    Or

    Always offer the user a copy of the 'not-to-be-saved' workbook, using
    Please Login or Register  to view this content.
    If you want to assist the user maximally you'd best use a userform.
    Last edited by snb; 07-11-2011 at 03:39 AM.



  6. #6
    Registered User
    Join Date
    06-26-2011
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2003
    Posts
    40

    Re: Prevent saving

    For the code from DocMed, do I post it to the ThisWorkbook under Excel Objects? If so, it's not working. How do I make it execut the code?

    If no, where should it go? Sorry, a little new to this. My questions are exceeding my skill level at this point.

+ 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