+ Reply to Thread
Results 1 to 6 of 6

Password Protecting within a Macro

  1. #1
    Registered User
    Join Date
    09-16-2014
    Location
    Durban, South Africa
    MS-Off Ver
    MS Excel Office 365
    Posts
    30

    Lightbulb Password Protecting within a Macro

    Hi

    I have created a workbook and password protected all my sheets, except for Specific Cells within Input Worksheets. Information input into these unprotected cells feed into other Calculation Worksheets and calculations are done there.

    I then recorded a Macro in order to save the information that was input into the Specific Cells within Input Worksheets. When recording the Macro I need to unprotect the relevant Calculation Worksheets, carry out a few commands and then Password Protect the sheet again and Stop the recording of the Macro.

    Every time I run the Macro for the first time after Password Protecting the sheet, MS Excel asks for the Password. After that, the Macro does not ask for the Password again and the functionality works fine, however on odd occasions, the Macro leaves the Calculation Worksheet unprotected.

    Is there anyway of ensuring that this does not happen?

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Password Protecting within a Macro

    Something wrong in your macro. Probably on an 'Exit Sub' or 'On Error Goto' you don't reactivate the protection.

  3. #3
    Registered User
    Join Date
    09-16-2014
    Location
    Durban, South Africa
    MS-Off Ver
    MS Excel Office 365
    Posts
    30

    Re: Password Protecting within a Macro

    Hi Rollis13

    Thanks for responding. Any idea how I would correct this?

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Password Protecting within a Macro

    .
    Post your workbook for review.

    Do not include confidential data in the workbook.

  5. #5
    Registered User
    Join Date
    09-16-2014
    Location
    Durban, South Africa
    MS-Off Ver
    MS Excel Office 365
    Posts
    30

    Re: Password Protecting within a Macro

    Hi

    The "Passivation Checklist" worksheet is the Input Worksheet, the "Passivation Database" worksheet is the Calculation Worksheet.

  6. #6
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Password Protecting within a Macro

    Sorry, no problem found in your macros.

+ 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] Macro Removes Password Protecting Sheet
    By sbrnard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2021, 03:48 PM
  2. [SOLVED] Issue Protecting Multiple Sheets (with password) using a Macro
    By Ncorette in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2019, 10:17 AM
  3. Protecting a worksheet with a password using a Macro
    By travis.cook21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-05-2016, 12:25 PM
  4. [SOLVED] Please help password protecting the file having macro already installed
    By gm2612 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-27-2013, 02:20 AM
  5. password protection macro not protecting all sheets the same
    By AKL01 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-21-2011, 05:05 PM
  6. Macro Protecting Sheets with Password
    By Emonk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2011, 03:24 PM
  7. [SOLVED] Protecting Password Info within a macro / Workaround
    By Ray Green in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-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