0

0

wps工作表保护密码忘记怎么办

藏色散人

藏色散人

发布时间:2020-03-18 10:43:20

|

34489人浏览过

|

来源于php中文网

原创

wps工作表保护密码忘记怎么办

wps工作表保护密码忘记怎么办?

下面是步骤方法:

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

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

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

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

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

从下面英文开始复制:

北极象沉浸式AI翻译
北极象沉浸式AI翻译

免费的北极象沉浸式AI翻译 - 带您走进沉浸式AI的双语对照体验

下载
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
-------------------

复制到横线以上

6、关闭编辑窗口;

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

8、 等一会,就会出现以下对话框:这就是Excel密码对应的原始密码(此密码和原先设置的密码都能打开此文档。如果是别人的文档,又想恢复密码设置,就可以用此密码进行保护,就能用设置的密码打开。字母一定要大写):

再点击确定。Excel的原始密码就被清除了。

相关专题

更多
wps替换快捷键
wps替换快捷键

在wps中替换按钮的快捷键是“CTRL+F”,使用此键就使用替换功能了,本专题提供wps替换快捷键相关的文章,希望能帮到大家。

468

2023.08.14

wps云文档空间满了怎么清除
wps云文档空间满了怎么清除

清除电脑wps云文档:1、任意打开一篇WPS文档,点击右上角的头像,进入个人中心;2、在【注册用户】下方,点击【更多云服务】旁下拉箭头,在弹出的对话框中点击“立即前往”;3、点击【立即前往】;4、在左侧【我的文档】可看到所有文档;5、选择文件,点右侧的三个点,点击【移至回收站】即可完成删除。清除手机wps云文档:1、在手机上打开WPS Office,点击下方的云文档;2、长按需要删除的文件,点击右上角的“全选”,或者根据自己的需求把需要

3325

2023.08.29

WPS打开Word乱码怎么办
WPS打开Word乱码怎么办

解决方法包括:选择正确的编码(如 utf-8 或 gbk);安装文档中使用的字体;尝试用其他软件打开文档,重新下载或获取文档;将系统语言设为与文档语言一致;禁用不必要的宏或插件。想了解更多WPS的相关内容,可以阅读本专题下面的文章。

539

2024.07.02

Office和Wps的区别
Office和Wps的区别

microsoft office提供更广泛的功能和市场领先的兼容性,但成本较高。wps针对基本办公任务提供了免费或低成本的替代方案,并具有更广泛的平台支持。想了解更多Office和Wps的相关内容,可以阅读本专题下面的文章。

1101

2024.07.10

WPS删除空白页的5种方法
WPS删除空白页的5种方法

wps删除空白页方法:按下“ctrl”+“end”+“delete”;在页面视图中删除页面缩略图;查找和替换空白页(空格字符);录制宏并删除空白页;在页面布局中将页边距全部设置为“0”。想了解更多WPS的相关内容,可以阅读本专题下面的文章。

1083

2024.07.25

为什么一打开wps就卡住了
为什么一打开wps就卡住了

一打开wps就卡住了的原因可能是资源占用过高、软件版本问题、插件冲突、缓存问题、病毒或恶意软件、系统兼容性问题、其他软件冲突或数据损坏等。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

588

2024.08.07

永久关闭WPS自动更新的两个方法
永久关闭WPS自动更新的两个方法

永久关闭wps自动更新的方法:1、修改注册表:在注册表中创建 dword 值 "autoupdateenable" 并将其值设置为 "0"。2、编辑 wps 配置文件:取消选中 "文件" 菜单中的 "自动检查更新" 选项。想了解更多wps的相关内容,可以阅读本专题下面的文章。

1906

2024.08.08

excel对比两列数据异同
excel对比两列数据异同

Excel作为数据的小型载体,在日常工作中经常会遇到需要核对两列数据的情况,本专题为大家提供excel对比两列数据异同相关的文章,大家可以免费体验。

1383

2023.07.25

PHP WebSocket 实时通信开发
PHP WebSocket 实时通信开发

本专题系统讲解 PHP 在实时通信与长连接场景中的应用实践,涵盖 WebSocket 协议原理、服务端连接管理、消息推送机制、心跳检测、断线重连以及与前端的实时交互实现。通过聊天系统、实时通知等案例,帮助开发者掌握 使用 PHP 构建实时通信与推送服务的完整开发流程,适用于即时消息与高互动性应用场景。

11

2026.01.19

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号