专业汉语词典知识平台,分享汉字词语知识、历史文学知识解答!

励北网
励北网

Excel表格保护密码忘了怎么办 Excel表格保护密码忘了解决办法

来源:小易整编  作者:小易  发布时间:2023-03-01 11:48
摘要:excel密码破解步骤如下:打开受密码保护的工作表工具--宏--录制新宏--输入名字如:hh停止录制(这样得到一个空宏)工具--宏--宏,选hh,点编辑按钮删除窗口中的所有字符,替换为下面的内容:PublicS...

  excel密码破解步骤如下:

Excel表格保护密码忘了怎么办 Excel表格保护密码忘了解决办法

  打开受密码保护的工作表

  工具---宏----录制新宏---输入名字如:hh

  停止录制(这样得到一个空宏)

  工具---宏----宏,选hh,点编辑按钮

  删除窗口中的所有字符,替换为下面的内容:

  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"

  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 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) & 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

  关闭编辑窗口 ,工具---宏-----运行,等1分钟,再确定.OK,没有密码了


本文地址:百科生活频道 https://www.neebe.cn/live/904047.html,易企推百科一个免费的知识分享平台,本站部分文章来网络分享,本着互联网分享的精神,如有涉及到您的权益,请联系我们删除,谢谢!


百科生活
小编:小易整编
相关文章相关阅读
  • 考试紧张怎么办,有效缓解压力(化解心理疲劳)

    考试紧张怎么办,有效缓解压力(化解心理疲劳)

    考试紧张怎么办,有效缓解压力(化解心理疲劳)考试紧张是很常见的现象,它可以在一定程度上刺激人的神经系统,但过度的紧张会产生负面影响,影响正常考试发挥。所以,我们需要有效地缓解考试压力,从而化解心理疲劳。以下是几个有用的方法:1.认识到自己的...

  • 怀孕女子还有2个月生产仍送外卖(怀孕女子还有2个月生产仍送外卖怎么办)

    怀孕女子还有2个月生产仍送外卖(怀孕女子还有2个月生产仍送外卖怎么办)

    魅妞服饰2023-05-01财经3本篇文章给大家谈谈怀孕女子还有2个月生产仍送外卖,以及怀孕女子还有2个月生产仍送外卖怎么办对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。女骑手怀孕6个月仍在送外卖,站长:她闲不...

  • 电子版结婚证(电子版结婚证查不到怎么办)

    电子版结婚证(电子版结婚证查不到怎么办)

    吴忧生活2023-05-01经验3今天给各位分享电子版结婚证的知识,其中也会对电子版结婚证查不到怎么办进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!电子结婚证电子结婚证是什今天给各位分享电子版...

  • 手机广告自动弹出怎么解决(小米手机广告自动弹出怎么解决)

    手机广告自动弹出怎么解决(小米手机广告自动弹出怎么解决)

    吴忧生活2023-05-01经验7本篇文章给大家谈谈手机广告自动弹出怎么解决,以及小米手机广告自动弹出怎么解决对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。手机总是自动弹出各种弹窗广告怎么办?若使用的vivo手...

  • 分区工具(分区工具系统盘变成d了怎么办)

    分区工具(分区工具系统盘变成d了怎么办)

    好助手百科2023-05-01百科3本篇文章给大家谈谈分区工具,以及分区工具系统盘变成d了怎么办对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。硬盘分区工具有哪些?很多电脑用户需要对磁盘进行分区,但是无奈找不到好...

  • 微信支持改微信号(微信改微信号忘记密码怎么办)

    微信支持改微信号(微信改微信号忘记密码怎么办)

    推一把2023-05-02经验3本篇文章给大家谈谈微信支持改微信号,以及微信改微信号忘记密码怎么办对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。微信号能改吗怎么改若使用的是vivo手机需要修改微信号,可以打开微...

  • 客户端版本非法(客户端版本非法怎么办)

    客户端版本非法(客户端版本非法怎么办)

    一条大河2023-05-01游戏3今天给各位分享客户端版本非法的知识,其中也会对客户端版本非法怎么办进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!刚下的疾风之刃打开后就说我客户端版本非法这怎么回...

  • excelvlookup(excelvlookup匹配多个数据)

    excelvlookup(excelvlookup匹配多个数据)

    好助手百科2023-05-02百科7今天给各位分享excelvlookup的知识,其中也会对excelvlookup匹配多个数据进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!excel中vloo...

  • 周排行
  • 月排行
  • 年排行

精彩推荐