View Single Post
  #36   Report Post  
Posted to microsoft.public.excel.misc
sld sld is offline
external usenet poster
 
Posts: 10
Default Can I protect all excel tabs in a file with one password entry

This is working, but when you have over 100 tabs it is hard to keep track of
when the last mesege box is going to error out on me. Is there a line that
I can enter that will give me a report that i can clearly see what was the
last tab, or can it take me to the tab that does not have the correct
password?

"Dave Peterson" wrote:

right where I wrote it. Just above the line causing the trouble.

Then when/if the line fails, you'll remember the last worksheet name that was
shown to you. That's the one to check.

SLD wrote:

Where do I insert the line you sugest?

For Each ws In ThisWorkbook.Worksheets

msgbox "Processing: " & ws.name
ws.Unprotect Password:="123"
Next ws


"Dave Peterson" wrote:

Depends on if that worked correctly and if anybody/any code changed the
password.

I'd still bet that the password isn't what you think.

SLD wrote:

if i used the protect all ws macroe, would that not put the same password on
all ws?

"Dave Peterson" wrote:

I'd bet that the password isn't really 123 for all the worksheets in the
workbook that contains the code.

Maybe you can add a line just to double check:

For Each ws In ThisWorkbook.Worksheets
msgbox "Processing: " & ws.name
ws.Unprotect Password:="123"
Next ws

That may give you a hint.


SLD wrote:

I copied the unprotect macroe

Sub Unprotect_All_Sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect Password:="123"
Next ws
End Sub

and it is still giving me an error on the 4th line. the passwords are the
same on both macroes.

What am I doing wrong?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson