专业游戏门户,分享手游网游单机游戏百科知识攻略!

嗨游网
嗨游网

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,没有密码了


本文地址:IT知识频道 https://www.eeeoo.cn/itzhishi/904047.html,嗨游网一个专业手游免费下载攻略知识分享平台,本站部分内容来自网络分享,不对内容负责,如有涉及到您的权益,请联系我们删除,谢谢!


IT知识
小编:小嗨整编
相关文章相关阅读
  • 穿越火线不能全屏怎么办(穿越火线进入游戏屏幕缩小)

    穿越火线不能全屏怎么办(穿越火线进入游戏屏幕缩小)

    有不少Windows10客户反映玩CF不能全屏!CF游戏设置里的全屏的勾打不上去,怎样处理Win10下玩CF无法全屏呢,其实Win10下玩CF无法全屏是正常现象,有些游戏本身并没有供给宽屏分辨率支撑。其图形界面都是按照必定份额(如4:...

  • 输入法图标(输入法图标不见了怎么办)

    输入法图标(输入法图标不见了怎么办)

    输入法图标(输入法图标丢失怎么办)本文教你如何恢复输入法图标,打开控制面板,双击区域和语言选项图标,进入区域和语言选项对话框,选择语言选项卡,点击详细信息按钮,在弹出的对话框中点击语言栏按钮,在接下来出现的语言栏设置对话框中勾选“在桌面上...

  • 变异系数怎么算(excel怎么算变异系数)

    变异系数怎么算(excel怎么算变异系数)

    如何计算变异系数(excel如何计算变异系数)算术平均数通过算术平均,可以得到预测目标在某个观测期的时间序列的算术平均值,作为下一个预测值。调和平均值调和平均值,也叫倒数平均值,是变量倒数的算术平均值的倒数。(1)简单平均公式(2)加权平...

  • 电源已接通 未充电(电源已接通未充电 真正解决办法)

    电源已接通 未充电(电源已接通未充电 真正解决办法)

       今天和大家分享一下关于电源是否接通不充电的问题(真正解决问题的方法是电源接通不充电)。以下是小编对这个问题的总结。让我们来看看。电源接通,说明电源接通,有指示灯,但是电脑没有充电。解决方案如下:1.右键单击电源按钮并选择电源选项。...

  • 玩英雄联盟卡怎么办(三大卡顿原因盘点)

    玩英雄联盟卡怎么办(三大卡顿原因盘点)

    打英雄联盟卡该怎么做(盘点卡顿三大原因)大家好,我是兼容机之家的小牛!《英雄联盟》作为一款流行的MOBA游戏,深受很多游戏玩家的喜爱,但就是这样一款简单的游戏,却让很多玩家着迷了好几年,从学校到社会,从笔记本到台式机。其实英雄联盟不是很喜...

  • 行李箱怎么设置密码锁(密码行李箱忘记密码怎么开锁)

    行李箱怎么设置密码锁(密码行李箱忘记密码怎么开锁)

    今天给大家分享一下如何设置行李箱密码锁的知识,同时也讲解一下忘记密码的情况下如何解锁密码行李箱。如果你碰巧解决了你现在面临的问题,别忘了关注这个网站,现在就开始!如何设置密码框按如下方式设置密码:工具/原材料:密码箱方法/步骤:1.先把行...

  • 如何祛斑效果最好(有什么办法可以祛斑或淡斑?)

    如何祛斑效果最好(有什么办法可以祛斑或淡斑?)

    如何获得更好的祛斑效果(有什么方法可以祛斑或者淡化斑点?)经常听到朋友跟我抱怨脸上不知不觉出现很多斑,心情越来越差。的确,色彩影响的不仅仅是美,还有心情。有什么办法可以解决色斑的问题?当然,老师整理了一些简单有效的祛斑方法和大家分享。我们...

  • excel乘法公式怎么用,excel乘法公式怎么输入

    excel乘法公式怎么用,excel乘法公式怎么输入

    excel乘法公式怎么用,excel乘法公式怎么输入摘要:方法一、1.打开excel表格,如图所示表格;2.在开始页面,点击空白单元格,点击上方“fx插入函数”;3.在弹出页面查找函数中输入“product”,点击下方“确定”;4.在弹出页...

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

精彩推荐