+ Reply to Thread
Results 1 to 3 of 3

Thread: Disable Save/Save As in Excel 2010

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Disable Save/Save As in Excel 2010

    Hello folks,

    First off thanks for the help on my previous post..

    I have an Exel 2010 workbook that I want people to fill out and print, but do not want Save or Save As function. I located the following, and it seems to work for me, but once I add it I can no longer save the file

    Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean)
        Cancel = True
        MsgBox "This file can not be saved - complete and print !"
    End Sub
    How can i save the file while this code is entered in?

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: Disable Save/Save As in Excel 2010

    Wouldn't it be simpler to just remove the entries before saving?
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  3. #3
    Valued Forum Contributor
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    1,957

    Re: Disable Save/Save As in Excel 2010

    Hi Todd, your post gave me an early morning laugh, thanks.

    To answer your question this macro turns events on and off. If you run it to turn events OFF you'll be able to save your workbook just fine. Run the macro again afterwards to turn events back ON.

    Sub Flip()
    
    Application.EnableEvents = Not (Application.EnableEvents)
    
    If Application.EnableEvents Then MsgBox "Events ON" Else MsgBox "Events OFF"
    
    End Sub

+ 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.2.0