excel表格怎么撤销工作表保护密码

我们经常使用Excel的工作表保护功能,用密码保护工作表,防止别人在操作时修改,但这样一来,有些操作(比如输入公式)可能就无法进行了,保护的密码时间长了可能就忘了。我该怎么办?只要按照以下步骤操作,Excel工作表保护密码就会瞬间被破解!

1、打开您需要破解保护密码的Excel文件;

2、依次点击菜单栏上的工具—宏—-录制新宏,输入宏名字如:aa;

excel表格怎么撤销工作表保护密码

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

excel表格怎么撤销工作表保护密码

4、依次点击菜单栏上的工具—宏—-宏,选aa,点编辑按钮;

excel表格怎么撤销工作表保护密码

excel表格怎么撤销工作表保护密码

5、删除窗口中的所有字符(只有几个),替换为下面的内容;

从横线下开始复制—————————–

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

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

———————-

复制到横线以上

excel表格怎么撤销工作表保护密码

6、关闭编辑窗口;

7、依次点击菜单栏上的工具—宏—–宏,选AllInternalPasswords,运行,确定两次;

excel表格怎么撤销工作表保护密码

excel表格怎么撤销工作表保护密码

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 86345@qq.com 举报,一经查实,本站将立刻删除。
(0)
上一篇 2022-04-16 01:00:05
下一篇 2022-04-16 01:10:09

猜你喜欢

  • 5寸照片大小是多少像素,5寸照片是多大尺寸

    五寸证件照(5寸照片)是生活中比较常见一种照片尺寸,如果是免冠证件照,一般会用于明显的展示位置(如工作人员公示栏、员工墙等),本文就只介绍五寸免冠证件照的尺寸大小,以及手机居家拍照…

    2023-09-02
  • miui13稳定版什么时候推送红米k30pro

    对于很多普通用户来说,用稳定版来更新系统,会减少很多bug,很多人不会更新到内测版或者开发板,所以很多米粉想知道miui13稳定版什么时候推,那个时候才会更新,那就让边肖给大家介绍…

    2022-05-12
  • 怎么消去肚子上的赘肉_如何有效消除肚子上的赘肉

    肚子上的赘肉多,也是人们的形象,爱美的女性朋友们,想穿一件紧身的瘦身裙,都没办法穿,突出的肚子,显得自己的身材特别的不好,那么怎么消除肚子上的赘肉呢?方法是什么呢?感兴趣的朋友们一…

    2023-05-21
  • 腾讯电脑管家怎么开护眼模式(腾讯电脑管家有没有护眼模式)

    为了长期使用电脑的用户的眼睛健康,腾讯电脑管家会帮助用户将系统的背景颜色从耀眼的白色搭配到柔和的绿色。长时间阅读文字时,柔和的背景色有助于缓解眼睛疲劳。 在健康小助手的第一个功能“…

    2022-04-25
  • 瓷砖缝怎么会发黑_瓷砖缝发黑的原因

    美缝,本来是为了美观和实用性而使用的一种施工方式,为什么很多家庭在做完美缝不久后,就出现了发黑的现象?你说说,这还怎么美观嘛!这到底是怎么一回事儿?为什么美缝会出现变色这一现象?今…

    2023-03-24
  • 哪里网购质量好_网购哪里最实惠

    网上购物时,经常会遇到平台提供的补贴活动,选择哪个平台购物时常困扰人们。到底阿里、京东、拼多多哪个更划算呢? 这个问题涉及到不同的方面和标准,有些平台便宜可能质量不高,也有些平台可…

    2023-03-12
  • 质检员是做什么的_质检员工作内容和职责

    1、负责生产过程中的质量检验和控制,以及产品的试验和测试; 2、对生产加工过程中出现的产品质量问题进行处理和分析,针对较大的质量问题做好反馈,提出改善方案或建议; 3、负责企业标准…

    2022-10-17
  • 蒙牛牛奶事件是真的吗_蒙牛牛奶最新消息

    相信不少消费者在互联网上都看到了有关于蒙牛黄曲霉素超标的视频,很容易让人信以为真。但是事实胜于雄辩,蒙牛牛奶最新事件调查结果已出:系属蓄意抹黑。 而中国载人航天工程办公室副主任杨利…

    2022-08-04
  • 石材销售怎么找客户?石材生意如何找客户?

    要搞好石材销售以下是一些建议: ·1、了解市场和行业。深入了解石材市场的需求,竞争对手和客户需求,定期关注行业动态和趋势,以便根据市场变化调整销售策略。 ·2、建立良好的客户关系。…

    2024-01-15
  • 电脑鼠标间歇性卡顿(鼠标移动的时候老是停顿)

    通常鼠标一停,鼠标的灵敏度就变差,这是光电鼠标的通病。具体表现为移动鼠标时,光标反应慢,不听命令。此硬件故障建议是立即更换新鼠标。不过最好还是通过下面的故障排除进行验证,找出鼠标暂…

    2022-04-19

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注