• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

macro to lock and unlock

jason

Member
Hey everyone!!


One of my roles is Document Control and in such position, I update 10000000000000000000000000 of documents (the number may be a bit of an exaggeration lol). to help speed up the process of protecting each document i created a macro. the thought was i would create a counter-macro that would simply unprotect a document. (i have a button for each; we all love buttons)


however, while the protect macro works wonderfully, the unprotect does not!! it gives me an error about the password not being correct!! and i KNOW that it is correct. as it unprotected the 'test file' that i used when recording the macro.


any ideas?
 
Try manually unlocking the workbook, make sure there's no typo? Double check code for typo? Care to post the macro (sans password, if you need) so we can double-check?
 
i did that... i acutally figured it out


apparently when i was recording myself unlocking the document, the code line wasn't written/constructed correctly. had to make a quick fix to the unprotect line and BAM!! its working lovely now!!
 
Back
Top