+ Reply to Thread
Results 1 to 8 of 8

avoid save file

  1. #1
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    avoid save file

    Hi All.
    I would like to avoid user to SAVE or SAVE AS file. In my macro I used code to disable SAVE and SAVE AS from FILE menu. But how to avoid to save file if user use CTRL+S command to save file?
    Thanks.
    Last edited by eugz; 04-30-2009 at 12:18 PM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: avoid save file

    In "ThisWorksheet" use the following code

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: avoid save file

    You might add
    Please Login or Register  to view this content.
    to that so the user doesn't keep getting prompted to save on exit.

    And as a courtesy, also add something to tell the user what's going on:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    Re: avoid save file

    Thanks Dave. It is works. But I'm thinking user will confused when will try close file and get message: "Do you want to save the changes you made "filename.xls"?" User try to click YES button and message will on screen. How to avoid save file and avoid pop up message also?
    Thanks.

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: avoid save file

    You'll need to incorperate

    Please Login or Register  to view this content.
    into your code to avoid the warning when closing.

  6. #6
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    Re: avoid save file

    I insert this code to ThisWorkbook
    Please Login or Register  to view this content.
    But message still pop up. What I did wrong?
    Thanks.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: avoid save file

    There is no Close event
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    Re: avoid save file

    Thanks a lot everyone. It is exactly what I want to do.

+ 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