+ Reply to Thread
Results 1 to 4 of 4

Code to force password to be entered on save - what's wrong?

  1. #1
    Registered User
    Join Date
    07-12-2021
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    8

    Code to force password to be entered on save - what's wrong?

    Hello,

    Absolute noob here. I am trying to protect my excel file from saving. I have disabled save as function and now want to make it so a password has to be entered in order to save the file. I found the following code online:

    Please Login or Register  to view this content.
    When I tried to save it threw an error. Could anyone tell me how to fix this code or if there is another code sequence that do the same job.

    Thanks in advance.

    Greg
    Last edited by AliGW; 07-12-2021 at 02:45 AM.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: What's wrong with this code

    Try like this.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,484

    Re: Code to force password to be entered on save - what's wrong?

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new here, I have done it for you today.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    07-12-2021
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Code to force password to be entered on save - what's wrong?

    Thanks bakerman2... that worked a treat

+ 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. [SOLVED] What is wrong with my code?
    By niuyuer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2016, 02:05 PM
  2. [SOLVED] Please, help me with the code for Similarity Factor Calc. My code gives wrong number.
    By Invictus1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-22-2015, 09:52 PM
  3. what is wrong with this code ?
    By segattoy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-28-2015, 06:20 AM
  4. what is wrong with this code- error from vba code
    By punna111 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2013, 03:14 PM
  5. Code for email alerts from excel isn't working, wrong code possibly?
    By jessthorogood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 01:45 AM
  6. Wrong line of code banned me out and can't access vba code...
    By albertc in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-14-2012, 02:41 PM
  7. What's the wrong with this code?
    By champs in forum Word Formatting & General
    Replies: 2
    Last Post: 03-02-2009, 06:54 AM

Tags for this Thread

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