+ Reply to Thread
Results 1 to 7 of 7

VBA Code to stop "SAVE AS"

  1. #1
    Registered User
    Join Date
    04-12-2017
    Location
    london
    MS-Off Ver
    2010
    Posts
    5

    VBA Code to stop "SAVE AS"

    Hi,

    Read and tried a few VBA codes that should stop the SAVE AS function being used and thus, prevent copying workbooks as different names to other locations etc.
    Problem is they never seem to work in practice.

    Can anyone provide a fools guide to creating the VBA Code in Excel to prevent users accessing the SAVE AS (not just save) and an associated message when trying to execute?

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: VBA Code to stop "SAVE AS"

    Please Login or Register  to view this content.
    The only issue with the above is if a user opens the file with macros disabled then the code won't run. Therefore, add a 'front page' to the workbook that has a line of text on it that says something like: "If you can read all the way to the end of this sentence before it clears from the screen then your macros are switched off and you cannot use this document."

    And in the workbook open event put code to remove that text.
    Last edited by BellyGas; 08-16-2017 at 10:49 AM.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,986

    Re: VBA Code to stop "SAVE AS"

    .
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: VBA Code to stop "SAVE AS"

    Just a note you may need to be in 'Design Mode' in the VB Editor to save the above code.

    and of course, it goes in your ThisWorkBook module code.

    But whats to stop someone from just copying and renaming the file?
    Last edited by ptmuldoon; 08-16-2017 at 10:54 AM.

  5. #5
    Registered User
    Join Date
    04-12-2017
    Location
    london
    MS-Off Ver
    2010
    Posts
    5

    Re: VBA Code to stop "SAVE AS"

    Stops me using the SAVE button now too, therefore I cannot save the document whatsoever?

  6. #6
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: VBA Code to stop "SAVE AS"

    Quote Originally Posted by bonsalp View Post
    Stops me using the SAVE button now too, therefore I cannot save the document whatsoever?
    What doesn't work? This lets me save the file, and not use SAVE AS

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-12-2017
    Location
    london
    MS-Off Ver
    2010
    Posts
    5

    Re: VBA Code to stop "SAVE AS"

    Thanks ptmuldoon, that works perfectly.

+ 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. Receiving "enable content" warning after executing "save as" code
    By phbryan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2014, 12:02 PM
  2. Code only runs when a user hits "Save", not "Save As"
    By cjstewart8 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-04-2014, 07:41 PM
  3. [SOLVED] Code to stop macro when "cancel" is clicked on
    By Devianey26 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2013, 01:57 PM
  4. [SOLVED] How to stop the "Save As" warning
    By heathbo in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-16-2013, 04:17 AM
  5. Stop "save changes" message appearing
    By DJ Dusty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2006, 10:42 AM
  6. [SOLVED] Stop "Save as" and Copy File
    By maperalia in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2005, 01:05 AM
  7. How do I stop the "do you want to save changes" prompt using VB code
    By john928 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2005, 12:05 PM

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