File has two passwords, I only set one password.

graphage

Board Regular
Joined
Mar 7, 2002
Messages
87
I have found an interesting situation. I have a large excel file. It was over 20 sheets, one sheet for each region. I have a macro that loops through the sheets, moves each sheet to a new workbook, puts a password on it, saves it based on the region name, closes the new file.

Then I email each sheet to the region manager, they input data into the unprotected cells, send it back to me, etc, etc.

I have one region that has continually been unprotecting my file, so I decided to call them and ask how they are getting around the protection. Their answer was simple, they said we are using the password "simpson", which happens to be the name of their region. BUT, this is not the password my code establishes, not even close. I opened the file and sure enough the password "simpson" does work, AND the password the VBA sets also works ("Saving Grace"). I tried some of the other workbooks that are created and "simpson" seems to work on them all.

Does anybody have any idea how two passwords could be working? This has me stumped. Any thoughts would be appreciated. Thank you!

Code:
Sub SeparateSheets()
Dim wb As Workbook
Dim ws As Worksheet
Dim wbNew As Workbook
Dim wsNew As Worksheet
Dim CurrMonthCol As String
Dim CurrMonthNum As String
Dim CurrMonthYr As String
Dim VP As String
Dim DeleteMonth As String
    
    CurrMonthCol = Sheets("notes").Range("B4").Value
    CurrMonthNum = Sheets("notes").Range("B6").Value
    CurrMonthYr = Sheets("notes").Range("B2").Value
    VP = Sheets("notes").Range("A1").Value
    DeleteMonth = Sheets("notes").Range("B9").Value
    Set wb = ActiveWorkbook
    
'Create Directory for Outbound
    If Dir("J:\Sales Technology\BSmith\Projections\Outbound\" & CurrMonthYr & " " & CurrMonthNum, vbDirectory) = "" Then
        MkDir "J:\Sales Technology\BSmith\Projections\Outbound\" & CurrMonthYr & " " & CurrMonthNum
    Else
        MsgBox (CurrMonthYr & " " & CurrMonthNum & " already exists in the Outbound folder.")
    End If

'Create Directory for Inbound
    If Dir("J:\Sales Technology\BSmith\Projections\Inbound\" & CurrMonthYr & " " & CurrMonthNum, vbDirectory) = "" Then
        MkDir "J:\Sales Technology\BSmith\Projections\Inbound\" & CurrMonthYr & " " & CurrMonthNum
    Else
        MsgBox (CurrMonthYr & " " & CurrMonthNum & " already exists in the Inbound folder.")
    End If

'Separate Sheets
    For Each ws In wb.Worksheets
        Select Case ws.Name
            Case "Projection System Load", "Budget System Load", "Consolidated", "HOME", "notes", "LY Actuals", "LY Actuals Raw", "SimpleSummaryDetailDump"
            Case Else
                'Blank out cells in Curr Month, based on formula within cell. Only blanks it out if the value = Bgt$.  Otherwise it leaves it cuz that means they have altered it.
                ws.Copy
                Set wbNew = ActiveWorkbook
                Set wsNew = ActiveSheet
                If DeleteMonth = "Y" Then
                    Application.ReferenceStyle = xlR1C1
                    Range(CurrMonthCol & ":" & CurrMonthCol).Replace What:="=RC[-1]", Replacement:=""
                    Application.ReferenceStyle = xlA1
                End If
                wsNew.Protect "SavingGrace"
                wbNew.Protect "SavingGrace"
                wbNew.SaveAs "J:\Sales Technology\SEisman\Projections\Outbound\" & CurrMonthYr & " " & CurrMonthNum & "\Projection For " & ws.Name & ".xlsx"
                wbNew.Close
        End Select
    Next ws
MsgBox "Worksheets Separated!", vbOKOnly
End Sub
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Security in Excel is...to put it nicely...is Less Than Stellar...


Here's an explaination I found on the internet..

Internal XL passwords are about as useful for security as tissue paper. The reason is that the passwords you enter (i.e., with Tools/Protect/Protect Worksheet or /Protect Workbook) are not used directly in protection. Instead they are hashed (mathematically transformed) into a much less secure code. Effectively, any password of any length is transformed into a string of 12 characters, the first 11 of which have one of only two possible values. The remaining character can have up to 95 possible values, leading to only


2^11 * 95 = 194,560
</PRE>potential passwords. This may seem like a lot, but it only takes a few seconds for a modern computer to try them all. As a comparison, a 4-character password containing just the 26 lower case alphabet characters has 456,976 combinations, and a 3-character password consisting of lower case, upper case and the digits 0-9 will have 238,328 combinations.
Again, it doesn't matter what your original password is, one of those 194K strings will unlock your sheet or workbook.
 
Upvote 0
Thank you for the reply. That is very interesting information! I setup a new workbook and sure enough....both passwords worked on it.
 
Upvote 0
This was scary…
I did not know it was THAT easy to break a password in Excel…

I tested it and also followed the instruction on: Link removed.


It worked perfectly, opened up all my “protected” workbooks…

So! What is the alternative? Is it possible to have a decent protection on an Excel workbook?

Can you protect a workbook with VBA?

/Linda
 
Last edited by a moderator:
Upvote 0
This was scary…
I did not know it was THAT easy to break a password in Excel…

I tested it and also followed the instruction on: Link removed.


It worked perfectly, opened up all my “protected” workbooks…

So! What is the alternative? Is it possible to have a decent protection on an Excel workbook?

Can you protect a workbook with VBA?

/Linda

I have removed your link. Please read the forum rule regarding passwords.
 
Upvote 0
So! What is the alternative? Is it possible to have a decent protection on an Excel workbook?

Can you protect a workbook with VBA?

/Linda

I got into a password protected module (Excel 2010, supposedly "vastly superior" encryption), in less than a minute.

Legitimately I might add, an employee thought it funny to password protect a couple of spreadsheets 30 days before he left (we have 10 days backups).

It's very simple which is why anyone in the know is aware that you never, ever, believe that anything in an Excel document is secure.
 
Upvote 0
It's very simple which is why anyone in the know is aware that you never, ever, believe that anything in an Excel document is secure.

Yes that’s a good rule.
I was thinking if it’s possible to add some kind of stronger protection with VBA. But I’m not that good on that.
/Linda
 
Upvote 0
Yes that’s a good rule.
I was thinking if it’s possible to add some kind of stronger protection with VBA. But I’m not that good on that.
/Linda

if you think about it, user has option to enable macros or even disable them completley so probably not!
Don't think that bit of info breaks any rule - but could be wrong.


Dave
 
Upvote 0
If you use earlier versions of OpenOffice to open password protected Excel documents, they seem to ignore the protection completely!
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,696
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top