Hi, this code was working, then for some reason it faults out at line 90 and I am using "UserInterfaceOnly:=True". I am puzzled why it quit working. Any help is appreciated
![]()
Please Login or Register to view this content.
Hi, this code was working, then for some reason it faults out at line 90 and I am using "UserInterfaceOnly:=True". I am puzzled why it quit working. Any help is appreciated
![]()
Please Login or Register to view this content.
I can think of a couple of things that could cause this, but without your file I don't know what did cause it.
You do not show the code that calls Protect. You may be doing UserInterfaceOnly:=True in one place but without it in another. Hard to say without seeing all of your code. You have a comment that says, "'Save the workbook after protecting" but there is no protection in sight.
If a user unprotects the sheet then reprotects it, UserInterfaceOnly:=True is no longer in force.
Hi
it seems you try to re-protect worksheets that already are protected
the sheet in the workbook called ("Outgoing") is already protected with a password "DjS"
so the code cant do 'Ws.Cells.Locked = True' because its already locked
i think thats what is giving you trouble
you might need to exclude the sheets you already lock with a password
Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
If you have been helped, maybe you could click the *
Thanks for the replies. Oddly this code does work, but the results isn't correct as it locks the wrong workbook, but it's doesn't fault.
![]()
Please Login or Register to view this content.
Well that was yet another Saturday brain fart. All I had to do was unprotect, lock, then protect each sheet and it worked!
If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."
If a member helped you solve your problem, consider adding to their reputation by clicking on the star icon addreputationiconsmall.jpg below their name.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks