+ Reply to Thread
Results 1 to 3 of 3

Exclude password to modify from copies when using SaveCopyAs

  1. #1
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Exclude password to modify from copies when using SaveCopyAs

    Hi All

    For clarity, this is not a question on bypassing passwords or security, this is about applying the security only where it is required.

    I have a template file which I have protected using (Save As > Tools > General Options > Password to Modify). Changes should only be saved to copies, not to the original.

    When I modify the file and manually Save As from the menu, the password protection is not applied to the new file, which is what I want.

    When I do the same thing using SaveCopyAs in vba, the password protection is also applied to the copy, this I don't want.

    Is it possible to save copies using vba without having the password applied to them? Other users should be free to manipulate the copies as needed without entering the password.

    Please Login or Register  to view this content.
    Where Folder, SubFolder and FileName are variables based on the changes made.

    Thanks in advance for any suggestions.

    Edit:- I looked as Save As instead of SaveCopyAs, but given that the code is looping and creating multiple copies with varied parameters, I can't see that it will work.
    Last edited by jason.b75; 12-01-2018 at 11:24 AM.

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Exclude password to modify from copies when using SaveCopyAs

    Hi Jason,

    What is happening if you use SaveAs (stringFilename, WriteResPassword:="")
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Exclude password to modify from copies when using SaveCopyAs

    Thanks for your input!

    I did try that previously, but it wasn't quite what I was looking for, although, in hindsight, I think that I can make it work with a couple of changes to the other code.

    The difference being, SaveAs closes the original file without saving changes, keeping the new, renamed version open, while SaveCopyAs keeps the original open and saves the new one in the background.

    At first glance, it looks like creating the first copy from the template, then the second copy from the first copy, etc is working as needed, in which case
    Please Login or Register  to view this content.
    at the end of my code should put me back to where I need to be.

    Thanks again for your help

+ 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. Replies: 1
    Last Post: 06-04-2015, 01:35 PM
  2. Replies: 2
    Last Post: 11-17-2014, 04:28 PM
  3. Password Protect On Open VBA with Range (SaveCopyAs)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-15-2014, 01:17 PM
  4. [SOLVED] Need to modify VBA Code that copies multiple sheets to a master sheet
    By AXGirl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-02-2014, 04:37 PM
  5. [SOLVED] Modify coditional format to exclude weekends and holidays
    By mrjinx007 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-03-2012, 11:23 AM
  6. SaveCopyAs with password support?
    By mariocatch in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2007, 03:58 PM
  7. Replies: 0
    Last Post: 04-26-2006, 10:25 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