问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

excel数据表设了密码,但是密码忘记了,怎么打开数据?

发布网友 发布时间:2022-06-26 10:13

我来回答

2个回答

热心网友 时间:2024-11-29 09:40

破解密码,一般人都会想到用软件来破解,而我们今天是用VBA来进行破解。首先打开VBA编辑器。  1、点击工具->宏->Visual Basic编辑器,打开VBA的编辑器。   2、在Visual Basic编辑器中,点击插入->模块,插入一个新的模块,我们的代码就是写到这个新的模块中的。   3、将下面的代码复制到模块中,不需改动任何代码。Option Explicit 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 & vbNewLine
Const AUTHORS As String = DBLSPACE & vbNewLine & _
"Adapted from Bob McCormick base code by" & _
"Norman Harker and JE McGimpsey"
Const HEADER As String = "AllInternalPasswords User Message"
Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04 " & vbCrLf & vbCrLf & "BeyondPC" & vbCrLf & " http://blog.sina.com.cn/beyondpc"
Const REPBACK As String = DBLSPACE & "Please report failure " & _
"to the microsoft.public.excel.programming newsgroup."
Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _
"now be free of all password protection, so make sure you:" & _
DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _
DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _
DBLSPACE & "Also, remember that the password was " & _
"put there for a reason. Don't stuff up crucial formulas " & _
"or data." & DBLSPACE & "Access and use of some data " & _
"may be an offense. If in doubt, don't."
Const MSGNOPWORDS1 As String = "There were no passwords on " & _
"sheets, or workbook structure or windows." & AUTHORS & VERSION
Const MSGNOPWORDS2 As String = "There was no protection to " & _
"workbook structure or windows." & DBLSPACE & _
"Proceeding to unprotect sheets." & AUTHORS & VERSION
Const MSGTAKETIME As String = "After pressing OK button this " & _
"will take some time." & DBLSPACE & "Amount of time " & _
"depends on how many different passwords, the " & _
"passwords, and your computer's specification." & DBLSPACE & _
"Just be patient! Make me a coffee!" & AUTHORS & VERSION
Const MSGPWORDFOUND1 As String = "You had a Worksheet " & _
"Structure or Windows Password set." & DBLSPACE & _
"The password found was: " & DBLSPACE & "$$" & DBLSPACE & _
"Note it down for potential future use in other workbooks by " & _
"the same person who set this password." & DBLSPACE & _
"Now to check and clear other passwords." & AUTHORS & VERSION
Const MSGPWORDFOUND2 As String = "You had a Worksheet " & _
"password set." & DBLSPACE & "The password found was: " & _
DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _
"future use in other workbooks by same person who " & _
"set this password." & DBLSPACE & "Now to check and clear " & _
"other passwords." & AUTHORS & VERSION
Const MSGONLYONE As String = "Only structure / windows " & _
"protected with the password that was just found." & _
ALLCLEAR & AUTHORS & VERSION & 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 BooleanApplication.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 'mmy 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) & Chr(j) & Chr(k) & _
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If .ProtectStructure = False And _
.ProtectWindows = False Then
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & 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) & Chr(j) & Chr(k) & _
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If Not .ProtectContents Then
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & 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 & AUTHORS & VERSION & REPBACK, vbInformation, HEADER
End Sub   4、粘帖完后,点击运行按钮,或按F5键,运行代码。   5、程序开始运行后,会弹出两次对话框,直接确定即可。

热心网友 时间:2024-11-29 09:40

发过来我给你破解!
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
联想E盘不见了怎么办? 电脑e盘不见了怎么恢复?6个步骤找回e盘 五一去河源万绿湖游玩,需要携带哪些物品? 五一假期,旅行必带的物品是什么 建行办新卡用了新手机号,旧卡就自动绑了信号 请问电磁炉热敏电阻阻值是多少 电磁炉换电阻多少钱 电磁炉配件电阻多少钱 电磁炉510K大电阻多少钱一个 更换电磁炉电阻多少钱 电信流量当月有效不结转什么意思? 会计中的不结转是什么意思 方便面可不可以当零食吃 方便面是零食吗? 妒忌心非常强,越相处越让人讨厌的星座有哪些? 11月1日 《弹珠传说》 第十五集《邪恶的妖刃战机》多杰克打出的最后一... 1. 12月6日 《弹珠传说》第五十集《决战桃源乡》小枫要用什么打开桃源之... 推饼怎么下载安装 社会主义制度什么时候正式确立 社会主义在中国确立的时间是 越相处越让人觉得讨厌的星座都有谁? 求房地产售楼部向客户介绍沙盘户型的解说词怎么向客户介绍沙盘呢?我... 自然香名字含义 建行快贷分期后可以提前还款吗- 问一问 led恒流驱动电源从五金店买吗? 多点电容触摸和电容触摸屏有区别? 越相处越让人喜欢不下去的星座有哪些? 我600793这支股票买了100股,6.58元买的,成本价却是6.69元,请问这是怎... 英氏辅食好吗?质量怎样?宝宝喜欢吗? 英氏辅食哪一款适合8个月的宝宝吃?求解答 越相处就会越讨厌的星座有哪几个? 常州博瑞是不是不好进 常州博瑞过年放几天假 常州市博瑞照明电器有限公司怎么样? 在一起后相处越久,越让男人离不开的星座有哪些? 第一次坐飞机的注意事项和详细流程。 我想娶个小姐做老婆,心理矛盾,原因是 娶个小姐做老婆大家有意见吗?都是什么人有意见?怎么解决呢? 真有人愿意娶一个小姐做老婆吗? 娶个小姐做老婆,有什么好处 你会娶一个做小姐的当老婆吗? 男人会不会娶一个小姐当老婆 你会娶一个小姐当老婆吗`? 肠胃里有咕噜咕噜的声音还有口臭是怎么回事? 口臭,胃难受,肚子有时咕咕叫,放屁特别臭,怎么办 胃部空 肚子晚上咕噜咕噜响,并有饥饿,嘴有口臭? 肚子老咕咕叫,舌苔厚有口气怎么回事 一岁半孩子晚上肚子噜咕噜响老哭有口臭吃什么药 大夫是怎么回事,口臭屁多肚子咕咕叫 看着不合群,越是相处越让人喜欢的星座有哪些?