+ Reply to Thread
Results 1 to 2 of 2

Way to save over or unprotect write protected files

  1. #1
    Registered User
    Join Date
    12-09-2009
    Location
    South Carolina
    MS-Off Ver
    Excel 2003
    Posts
    1

    Way to save over or unprotect write protected files

    Is there a way to write a macro to save over a write protected file which I know the password for? Alternatively, can i simply disable the write protection on the file with the macro before saving it to another file name?

    My situation is that we have a file which is updated daily but is a monthly workbook. This file must be write protected. At the end of every month, some changes need to be made with a macro and then it needs to be saved to an archive folder before it is cleared for the next month. This would not be a problem for the first year. However, the second year, when the files for each month already exist (i suppose if I can't solve this I can just remove them yearly) I will get an error that says I can't save over the file because it is write protected. I only get this error when saving through the macro and do not get it if I save manually.

    I was thinking that if I can't do that, then perhaps I could disable the write protection with a macro and then save it to the archive folder so none of the archived files will be right protected. This is certainly the less optimal option.

  2. #2
    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: Way to save over or unprotect write protected files

    Here's a function that will change file attributes:
    Please Login or Register  to view this content.
    The first example in the code clears the read-only attribute.
    Entia non sunt multiplicanda sine necessitate

+ 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