+ Reply to Thread
Results 1 to 5 of 5

Macro to copy cells to a password-protected spreadsheet

  1. #1
    Forum Contributor
    Join Date
    04-19-2016
    Location
    Michigan
    MS-Off Ver
    15.0
    Posts
    130

    Macro to copy cells to a password-protected spreadsheet

    Good evening peeps,

    I have a macro that displays a userform that allows users to export calculated cells to another spreadsheet in the same directory. This function has been working well - but now I want to implement a password to lock that second spreadsheet (so while users can add new entry to this second spreadsheet via the first one's userform, they cannot view or edit this second file by directly opening it). I attempted the code below but it still prompts for the password as I try to export it from the first spreadsheet.

    Any idea would help! Thanks!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,264

    Re: Macro to copy cells to a password-protected spreadsheet

    Have you protected the second workbook? Or just the worksheet within the workbook? You are just providing the worksheet password. You need to provide the workbook open password

    https://msdn.microsoft.com/en-us/lib.../ff194819.aspx
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    04-19-2016
    Location
    Michigan
    MS-Off Ver
    15.0
    Posts
    130

    Re: Macro to copy cells to a password-protected spreadsheet

    Good morning,

    I thought I did, I choose "protect work book" and encrupt it with a
    2xffUYg.png

    And then I ran the userform and ran into this:

    iDrp8FQ.png

    Please help!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,264

    Re: Macro to copy cells to a password-protected spreadsheet

    Please Login or Register  to view this content.
    requires you to provide the password to open it.

  5. #5
    Forum Contributor
    Join Date
    04-19-2016
    Location
    Michigan
    MS-Off Ver
    15.0
    Posts
    130

    Re: Macro to copy cells to a password-protected spreadsheet

    Good morning,

    Yes I figure that would be the issue - I wonder rather than Sheets (1) - I can Unprotect Password the whole workbook??

    Please Login or Register  to view this content.

+ 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: 7
    Last Post: 03-22-2017, 11:53 AM
  2. macro that inputs the password on a password protected document
    By dandavis1 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-09-2014, 10:12 AM
  3. PLEASE HELP! Copy sheet with password protected cells debug error
    By bsnapool in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-10-2006, 07:04 AM
  4. [SOLVED] Can a Works spreadsheet be password protected?
    By bucksguy14 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 05-01-2006, 02:10 PM
  5. [SOLVED] insert password protected spreadsheet
    By RZT27Y in forum Excel General
    Replies: 1
    Last Post: 09-30-2005, 06:05 PM
  6. How do I unlock a spreadsheet that is password protected?
    By Moke in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-25-2005, 11:06 PM
  7. [SOLVED] password protected certain cells in spreadsheet
    By vv in forum Excel General
    Replies: 2
    Last Post: 02-09-2005, 07: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