乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > 破解Excel工作表别人设置的保护密码-excel密码破解

破解Excel工作表别人设置的保护密码-excel密码破解

作者:乔山办公网日期:

返回目录:excel表格制作

工作中有些人为了保护自己的资料不别任何人修改,就需要设置工资表保护密码。只有知道密码的人才可以修改。但是有时候很急需要往里面添加资料。就得需要破解密码

破解<a href='https://www.qiaoshan022.cn/tags/Excelgongzuobiao_4971_1.html' target='_blank'>Excel工作表</a>别人设置的保护密码

别人设置的密码只能看不能编辑

破解Excel工作表别人设置的保护密码

点击撤销工资表保护需要密码

破解Excel工作表别人设置的保护密码

我们点击查看代码

破解Excel工作表别人设置的保护密码

或者点击查看代码

破解Excel工作表别人设置的保护密码

粘贴下面的代码

Public Sub AllInternalPasswords()

' Breaks worksheet and workbook structure passwords. Bob McCormick

' probably originator of base code algorithm modified for coverage

' of workbook structure / windows passwords and for multiple passwords

'

' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)

' Modified 2003-Apr-04 by JEM: All msgs to constants, and

' eliminate one Exit Sub (Version 1.1.1)

' Reveals hashed passwords NOT original passwords

Const DBLSPACE As String = vbNewLine &amp; vbNewLine

Const AUTHORS As String = DBLSPACE &amp; vbNewLine &amp; _

"Adapted from Bob McCormick base code by" &amp; _

"Norman Harker and JE McGimpsey"

Const HEADER As String = "AllInternalPasswords User Message"

Const VERSION As String = DBLSPACE &amp; "Version 1.1.1 2003-Apr-04"

Const REPBACK As String = DBLSPACE &amp; "Please report failure " &amp; _

"to the microsoft.public.excel.programming newsgroup."

Const ALLCLEAR As String = DBLSPACE &amp; "The workbook should " &amp; _

"now be free of all password protection, so make sure you:" &amp; _

DBLSPACE &amp; "SAVE IT NOW!" &amp; DBLSPACE &amp; "and also" &amp; _

DBLSPACE &amp; "BACKUP!, BACKUP!!, BACKUP!!!" &amp; _

DBLSPACE &amp; "Also, remember that the password was " &amp; _

"put there for a reason. Don't stuff up crucial formulas " &amp; _

"or data." &amp; DBLSPACE &amp; "Access and use of some data " &amp; _

"may be an offense. If in doubt, don't."

Const MSGNOPWORDS1 As String = "There were no passwords on " &amp; _

"sheets, or workbook structure or windows." &amp; AUTHORS &amp; VERSION

Const MSGNOPWORDS2 As String = "There was no protection to " &amp; _

"workbook structure or windows." &amp; DBLSPACE &amp; _

"Proceeding to unprotect sheets." &amp; AUTHORS &amp; VERSION

Const MSGTAKETIME As String = "After pressing OK button this " &amp; _

"will take some time." &amp; DBLSPACE &amp; "Amount of time " &amp; _

"depends on how many different passwords, the " &amp; _

"passwords, and your computer's specification." &amp; DBLSPACE &amp; _

"Just be patient! Make me a coffee!" &amp; AUTHORS &amp; VERSION

Const MSGPWORDFOUND1 As String = "You had a Worksheet " &amp; _

"Structure or Windows Password set." &amp; DBLSPACE &amp; _

"The password found was: " &amp; DBLSPACE &amp; "$$" &amp; DBLSPACE &amp; _

"Note it down for potential future use in other workbooks by " &amp; _

"the same person who set this password." &amp; DBLSPACE &amp; _

"Now to check and clear other passwords." &amp; AUTHORS &amp; VERSION

Const MSGPWORDFOUND2 As String = "You had a Worksheet " &amp; _

"password set." &amp; DBLSPACE &amp; "The password found was: " &amp; _

DBLSPACE &amp; "$$" &amp; DBLSPACE &amp; "Note it down for potential " &amp; _

"future use in other workbooks by same person who " &amp; _

"set this password." &amp; DBLSPACE &amp; "Now to check and clear " &amp; _

"other passwords." &amp; AUTHORS &amp; VERSION

Const MSGONLYONE As String = "Only structure / windows " &amp; _

"protected with the password that was just found." &amp; _

ALLCLEAR &amp; AUTHORS &amp; VERSION &amp; REPBACK

Dim w1 As Worksheet, w2 As Worksheet

Dim i As Integer, j As Integer, k As Integer, l As Integer

Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer

Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer

Dim PWord1 As String

Dim ShTag As Boolean, WinTag As Boolean

Application.ScreenUpdating = False

With ActiveWorkbook

WinTag = .ProtectStructure Or .ProtectWindows

End With

ShTag = False

For Each w1 In Worksheets

ShTag = ShTag Or w1.ProtectContents

Next w1

If Not ShTag And Not WinTag Then

MsgBox MSGNOPWORDS1, vbInformation, HEADER

Exit Sub

End If

MsgBox MSGTAKETIME, vbInformation, HEADER

If Not WinTag Then

MsgBox MSGNOPWORDS2, vbInformation, HEADER

Else

On Error Resume Next

Do 'dummy do loop

For i = 65 To 66: For j = 65 To 66: For k = 65 To 66

For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66

For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66

For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126

With ActiveWorkbook

.Unprotect Chr(i) &amp; Chr(j) &amp; Chr(k) &amp; _

Chr(l) &amp; Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; _

Chr(i3) &amp; Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)

If .ProtectStructure = False And _

.ProtectWindows = False Then

PWord1 = Chr(i) &amp; Chr(j) &amp; Chr(k) &amp; Chr(l) &amp; _

Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; Chr(i3) &amp; _

Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)

MsgBox Application.Substitute(MSGPWORDFOUND1, _

"$$", PWord1), vbInformation, HEADER

Exit Do 'Bypass all for...nexts

End If

End With

Next: Next: Next: Next: Next: Next

Next: Next: Next: Next: Next: Next

Loop Until True

On Error GoTo 0

End If

If WinTag And Not ShTag Then

MsgBox MSGONLYONE, vbInformation, HEADER

Exit Sub

End If

On Error Resume Next

For Each w1 In Worksheets

'Attempt clearance with PWord1

w1.Unprotect PWord1

Next w1

On Error GoTo 0

ShTag = False

For Each w1 In Worksheets

'Checks for all clear ShTag triggered to 1 if not.

ShTag = ShTag Or w1.ProtectContents

Next w1

If ShTag Then

For Each w1 In Worksheets

With w1

If .ProtectContents Then

On Error Resume Next

Do 'Dummy do loop

For i = 65 To 66: For j = 65 To 66: For k = 65 To 66

For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66

For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66

For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126

.Unprotect Chr(i) &amp; Chr(j) &amp; Chr(k) &amp; _

Chr(l) &amp; Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; Chr(i3) &amp; _

Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)

If Not .ProtectContents Then

PWord1 = Chr(i) &amp; Chr(j) &amp; Chr(k) &amp; Chr(l) &amp; _

Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; Chr(i3) &amp; _

Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)

MsgBox Application.Substitute(MSGPWORDFOUND2, _

"$$", PWord1), vbInformation, HEADER

'leverage finding Pword by trying on other sheets

For Each w2 In Worksheets

w2.Unprotect PWord1

Next w2

Exit Do 'Bypass all for...nexts

End If

Next: Next: Next: Next: Next: Next

Next: Next: Next: Next: Next: Next

Loop Until True

On Error GoTo 0

End If

End With

Next w1

End If

MsgBox ALLCLEAR &amp; AUTHORS &amp; VERSION &amp; REPBACK, vbInformation, HEADER

End Sub

把这段代码粘贴到代码框里面。等待一到两分钟。期间会弹出几个对话框。

破解Excel工作表别人设置的保护密码

运行期间会有几个对话框点确定就好

破解Excel工作表别人设置的保护密码

破解Excel工作表别人设置的保护密码

破解Excel工作表别人设置的保护密码

关掉代码窗口。保存会出现这样提示点击是

破解Excel工作表别人设置的保护密码

成果

破解Excel工作表别人设置的保护密码

方便你我他

喜欢就收藏备用,谢谢大家多多关注啊!

相关阅读

关键词不能为空
极力推荐
  • Excel VBA(15) – 用VBA给表格排序-excel表格排序

  • excel表格排序,代码虽然换行,但还是一整句,所以在这后面无法添加注释Header:=xlYes:需要包含标题,如果不需要,就写xlNo2.制作按钮:1)在表格界面点击“开发工具”-->“插入”

ppt怎么做_excel表格制作_office365_word文档_365办公网