+ Reply to Thread
Results 1 to 12 of 12

Help neded! Password restricting/protecting copy file!

  1. #1
    Registered User
    Join Date
    08-22-2013
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2010
    Posts
    43

    Help neded! Password restricting/protecting copy file!

    I would like to password protect the excel workbook. You need a password to view the contents of the workbook!
    I figure how to do that with the original file!
    The problem is i have a macro that creates a copy of itself and clears the contents for the next use (ie. like Invoice), and i would like to protect the copy file!
    Please Help!

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Help neded! Password restricting/protecting copy file!

    I don't understand your question.


    click on the * Add Reputation if this was useful or entertaining.

  3. #3
    Registered User
    Join Date
    11-06-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Help neded! Password restricting/protecting copy file!

    i think your looking for ActiveWorkbook.Protect after you save it.

  4. #4
    Registered User
    Join Date
    08-22-2013
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Help neded! Password restricting/protecting copy file!

    I have protected workbook, (I know how to do that) what i mean is that you can only put info in the selected cells!
    When you click save button (macro assign to it) it will save all the content (make a copy of it self in different folder), make a new reference number and clear the cells that need to be cleared!
    What i need now is the copy file, I want to restrict who is able to read a file and adjust the contents!
    Please Login or Register  to view this content.
    This code only works for original file, not the copy!

  5. #5
    Registered User
    Join Date
    11-06-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Help neded! Password restricting/protecting copy file!

    I'm sorry then, like tony I don't think I understand your question.

  6. #6
    Registered User
    Join Date
    11-06-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Help neded! Password restricting/protecting copy file!

    let me take one more swing at this. would it work to fix this in windows instead of vba? can you just set acl's to limit file access to the folder you save it into?

  7. #7
    Registered User
    Join Date
    08-22-2013
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Help neded! Password restricting/protecting copy file!

    Possibly, but i do not know how!

  8. #8
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Help neded! Password restricting/protecting copy file!

    You can find all the locked cells using the below. You will just need to loop through them clearing each cell

    Please Login or Register  to view this content.
    The file save is saving to a fixed file name so the copy will try and overwrite itself - and probably fail. Try this version

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-22-2013
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Help neded! Password restricting/protecting copy file!

    Please Login or Register  to view this content.
    This is how my file is copied and saved!
    Now, what i want to do is, when you open a copy file, prompts you to put a password in before viewing the file!
    And if i adjust the code above it makes the original file password protected rather than copy!
    Last edited by dgavranovic; 02-27-2014 at 12:51 PM.

  10. #10
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Help neded! Password restricting/protecting copy file!

    To save a file with macros you need a .xlsm file and also the right FileFormat as below


    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    11-06-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Help neded! Password restricting/protecting copy file!

    i think if im reading right you want the new file to be password protected so you can't open it without the password? try this.
    Please Login or Register  to view this content.
    Last edited by timmatthews; 02-27-2014 at 01:44 PM. Reason: remove unneeded line of code

  12. #12
    Registered User
    Join Date
    08-22-2013
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Help neded! Password restricting/protecting copy file!

    Thank you timmatthews!
    It works!

+ 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] Password protecting 7-zip file
    By DanzaNZ in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-17-2015, 03:48 AM
  2. Protecting and Reading password from text file
    By rkayasth in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-26-2010, 08:09 PM
  3. VBA for password protecting file
    By dhrestak in forum Word Programming / VBA / Macros
    Replies: 8
    Last Post: 07-12-2010, 10:12 AM
  4. Password Protecting cells in shared file
    By robmharrison in forum Excel General
    Replies: 2
    Last Post: 10-17-2008, 11:45 AM
  5. Password protecting certain worksheets in a file
    By Mike in forum Excel General
    Replies: 1
    Last Post: 03-29-2005, 11:06 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