+ Reply to Thread
Results 1 to 6 of 6

Error message when the work sheet is protected with password

  1. #1
    Registered User
    Join Date
    10-19-2012
    Location
    Houston, US
    MS-Off Ver
    Excel 2007
    Posts
    46

    Error message when the work sheet is protected with password

    Hello Forum,
    I have a workbook with 2 VBA codes. The workbook and the codes work fine until I protect the sheet with password. It stills give me the correct result but as the same time it gives the error:

    Run-time error '1004:
    Application-defined or object-defined error

    How can I remove this error message when the work sheet is protected with password?
    Thank you so much for your help
    Thup_98


    Please Login or Register  to view this content.



    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Error message when the work sheet is protected with password

    Not tested solution, but you are making changes within a Change event handler. You should switch off event handling to avoid looping.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-19-2012
    Location
    Houston, US
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Error message when the work sheet is protected with password

    Hi Invisibleman
    Thank you for your advice but I cannot make it works. Could you please give more detail?
    For temp. solution I format the “NA” & “0”cells to unlocked when worksheet password protected then everything is OK in this case, because the cells value are pulled from data validation functions which store in another password protected tab so the user cannot change the value of the cells, but I think we still can solve this problem through VBA anybody has any idea?
    Your help is greatly appreciated.
    Thup_98

  4. #4
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Error message when the work sheet is protected with password

    '
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-19-2012
    Location
    Houston, US
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Error message when the work sheet is protected with password

    Brilliant! It works perfectly.
    Thank you InvisibleMan
    Thup_98

  6. #6
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Error message when the work sheet is protected with password

    You're welcome. Thanks for the rep.

+ 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: 3
    Last Post: 01-29-2016, 03:57 PM
  2. password protected hide sheet not work properle
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-30-2013, 09:40 AM
  3. Macros stop to work when work sheet is protected. Run time error 1004
    By sellim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2012, 01:14 AM
  4. Error Handler for Incorrect Password (Protected Sheet)
    By jasoncw in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-01-2007, 06:44 PM
  5. 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
  6. [SOLVED] Error message with protected sheet
    By HRman in forum Excel General
    Replies: 1
    Last Post: 11-28-2005, 03:10 PM
  7. Custom Error Message for Protected sheet
    By hailnorm in forum Excel General
    Replies: 1
    Last Post: 01-25-2005, 03:03 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