在做excel表格时我们有时候会给自己的工作表加密,一旦忘记密码就会很麻烦,下面我们就介绍一下如何绕过密码,直接撤销保护 。
打开excel,点击菜单栏的“视图”,点击二级菜单里的“宏”,选择录制宏

文章插图
在弹出来的方框中输入宏的名称,点击确认 。

文章插图
重复第一步的步骤,不过这次点击“停止录制” 。

文章插图
选择查看宏 。

文章插图
编辑宏 。
在弹出来的代码框输入下面的代码 。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"
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
- 人工饲养的螃蟹有激素吗 醉蟹有寄生虫吗
- 中工请问泡蜂巢蜜浮在上面的蜡能吃吗 蜂巢蜜的蜂蜡可以吃吗
- 离子束加工和激光加工相比 离子束真的能治好凹陷疤痕吗
- 先德gp100医用红外额温计说明书 哈工大的先德纳米治疗仪说明书
- 一龄集团靠谱吗 博鳌一龄工资高吗
- 美容工作室装修一个十五平方的盐浴纳米汗蒸房多少钱 做一个盐蒸房要多少钱
- 工作餐用餐有时间规定吗 工作餐图片
- 工字搓背什么时候做比较好 背部按摩发朋友圈文案
- 工业用水经过水处理后水质硬偏碱加盐酸和加明矾能行吗 怎么治疗硬度的问题
- 马拉松丈量员|马拉松丈量员主要用什么交通工具丈量赛道 蚂蚁新村12月19日答案
特别声明:本站内容均来自网友提供或互联网,仅供参考,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
