移除Excel文档VBA密码保护

合集下载

解除Excel密码保护的方法

解除Excel密码保护的方法

Excel密码保护的解除方法Excel密码保护的解除方法与解除原理Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。

若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。

可能会提示您输入密码。

”窗口,如下图。

出现这种情况,应该怎么解决呢?经过研究,找到了两种破解Excel工作表保护码的方法。

一、VBA宏代码破解法:第一步:打开该文件,首先确认“宏”未被禁用,再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:ABCDE(随意命名,如下图),点击“确定”退出;第二步:再点击“宏”→“查看宏”,选择“宏名”下的“ABCDE”并点击“编辑”,打开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码:Sub ABCDE()Dim i As Integer, j As Integer, k As IntegerDim l As Integer, m As Integer, n As IntegerDim i1 As Integer, i2 As Integer, i3 As IntegerDim i4 As Integer, i5 As Integer, i6 As IntegerOn Error Resume NextFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126ActiveSheet.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 ActiveSheet.ProtectContents = False ThenMsgBox "One usable password is " & Chr(i) & Chr(j) & _Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)ActiveWorkbook.Sheets(1).SelectRange("a1").FormulaR1C1 = Chr(i) & Chr(j) & _Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)Exit SubEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextEnd Sub第三步:替换完窗口中的所有代码后,按F5,运行代码(需要一点时间,大概10秒钟)会出现(下图),图中:AAAABBAABBBO就是通用的宏密码(此密码不一定就是原来设置的密码)。

Excel表格密码保护的解除方法

Excel表格密码保护的解除方法

Excel表格密码保护的解除方法表格受密码保护时,我们修改数据Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。

若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。

可能会提示您输入密码。

这时候我们可以用VBA宏代码破解法来破解表格保护密码:第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮,打开“Microsoft Office安全选项”窗口,选择其中的“启用此内容”,“确定”。

再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:PasswordBreaker,点击“确定”退出;第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,打开“MicrosoftVisualBasic”编辑器,用如下内容替换右侧窗口中的所有代码:SubPasswordBreaker()DimiAsInteger,jAsInteger,kAsIntegerDimlAsInteger,mAsInteger,nAsIntegerDimi1AsInteger,i2AsInteger,i3AsIntegerDimi4AsInteger,i5AsInteger,i6AsIntegerOnErrorResumeNextFori=65To66:Forj=65To66:Fork=65To66Forl=65To66:Form=65To66:Fori1=65To66Fori2=65To66:Fori3=65To66:Fori4=65To66Fori5=65To66:Fori6=65To66:Forn=32To126(i)&Chr(j)&Chr(k)&_Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&Chr(i3)&_Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)=FalseThenMsgBox"Oneusablepasswordis"&Chr(i)&Chr(j)&_Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_Chr(i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)(1).SelectRange("a1").FormulaR1C1=Chr(i)&Chr(j)&_Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_Chr(i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)ExitSubEndIfNext:Next:Next:Next:Next:NextNext:Next:Next:Next:Next:NextEndSub第三步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“执行”,密码就现形了第四步:点击“撤消工作表保护”,然后输入密码即可解除锁定;测试结果,密码破解可用,但是很晕的是破解的密码跟原来的密码有很大的差距,想不明白了,反正能用就好。

清除excel的工作表密码的VBA代码

清除excel的工作表密码的VBA代码
vbNewLine & _
vbNewLine & _
"**********************************************************************************************" & _
vbNewLine & _
"另:请高手能为此程序添加进度条!以免不知道电及脑是否已经死机!期待中!谢谢!" & _
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
If a = vbNo Then
Exit Sub
Else
MsgBox "清除密码的时间会很长,像死机一样!" & _
vbNewLine & _
vbNewLine & _
vbNewLine & _
vbNewLine & _
vbNewLine & _
"中途可以通过Ctrl+Break中断程序!", vbInformation, HEADER '自己加的几句废话
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If

去除Excel工作表保护密码

去除Excel工作表保护密码

去除Excel工作表保护密码操作步骤:1. 打开需要破解密码的Excel;2. Alt+F11,进入VBA编辑界面;3. 插入-- 模块(Module);4. 在右边Module的空白编辑区域,复制粘贴下面所有内容;5. F5,运行该VBA命令;Option ExplicitPublic 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 passwordsConst DBLSPACE As String = vbNewLine & vbNewLineConst 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 & VERSIONConst 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 & VERSIONConst MSGONLYONE As String = "Only structure / windows " & _ "protected with the password that was just found." & _ ALLCLEAR & AUTHORS & VERSION & REPBACKDim w1 As Worksheet, w2 As WorksheetDim i As Integer, j As Integer, k As Integer, l As IntegerDim m As Integer, n As Integer, i1 As Integer, i2 As IntegerDim i3 As Integer, i4 As Integer, i5 As Integer, i6 As IntegerDim PWord1 As StringDim ShTag As Boolean, WinTag As BooleanApplication.ScreenUpdating = FalseWith ActiveWorkbookWinTag = .ProtectStructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 In WorksheetsShTag = ShTag Or w1.ProtectContentsNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWORDS1, vbInformation, HEADERExit SubEnd IfMsgBox MSGTAKETIME, vbInformation, HEADERIf Not WinTag ThenMsgBox MSGNOPWORDS2, vbInformation, HEADERElseOn Error Resume NextFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For 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 ThenPWord1 = 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, HEADERExit Do 'Bypass all for...nextsEnd IfEnd WithNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfIf WinTag And Not ShTag ThenMsgBox MSGONLYONE, vbInformation, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In Worksheets'Attempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets'Checks for all clear ShTag triggered to 1 if not. ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith w1If .ProtectContents ThenOn Error Resume NextFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For 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 ThenPWord1 = 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 sheetsFor Each w2 In Worksheetsw2.Unprotect PWord1Next w2Exit Do 'Bypass all for...nextsEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfEnd WithNext w1End IfMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER End Sub。

如何撤销工作表保护

如何撤销工作表保护

E x c e l密码保护的解除方法与解除原理出现这种情况,应该怎么解决呢?经过研究,找到了两种破解Excel工作表保护码的方法。

一、VBA宏代码破解法:第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮,打开“MicrosoftOffice安全选项”窗口,选择其中的“启用此内容”,“确定”退出(图2);再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:PasswordBreaker(图3),点击“确定”退出;第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,打开“MicrosoftVisualBasic”编辑器,用如下内容替换右侧窗口中的所有代码:SubPasswordBreaker()DimiAsInteger,jAsInteger,kAsIntegerDimlAsInteger,mAsInteger,nAsIntegerDimi1AsInteger,i2AsInteger,i3AsIntegerDimi4AsInteger,i5AsInteger,i6AsIntegerOnErrorResumeNextFori=65To66:Forj=65To66:Fork=65To66Forl=65To66:Form=65To66:Fori1=65To66Fori2=65To66:Fori3=65To66:Fori4=65To66Fori5=65To66:Fori6=65To66:Forn=32To126(i)&Chr(j)&Chr(k)&_Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&Chr(i3)&_Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)=FalseThenMsgBox"Oneusablepasswordis"&Chr(i)&Chr(j)&_Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_Chr(i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)(1).SelectRange("a1").FormulaR1C1=Chr(i)&Chr(j)&_Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_Chr(i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)ExitSubEndIfNext:Next:Next:Next:Next:NextNext:Next:Next:Next:Next:NextEndSub第三步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“执行”,密码就现形了(图4)。

Excel单元格密码保护去除(实测可行)

Excel单元格密码保护去除(实测可行)

用VBA宏代码破解Excel单元格密码保护第一步:打开该文件,先解除默认的“宏禁用”状态。

方法是:把工具栏下的【宏】→【安全性】中的【安全级】设置为中或者为低即可。

再切换到工具栏下的【宏】→【录制新宏】,出现“录制新宏”窗口,在“宏名”定义一个名称为:PassWordBreaker,点击“确定”退出;第二步:再点击工具栏下的【宏】→【宏(M)】,选择“宏名”下的“PasswordBreaker”并点击“编辑”,打开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码:Sub PasswordBreaker()Dim i As Integer, j As Integer, k As IntegerDim l As Integer, m As Integer, n As IntegerDim i1 As Integer, i2 As Integer, i3 As IntegerDim i4 As Integer, i5 As Integer, i6 As IntegerOn Error Resume NextFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126ActiveSheet.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 ActiveSheet.ProtectContents = False ThenMsgBox "One usable password is " & Chr(i) & Chr(j) & _Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)ActiveWorkbook.Sheets(1).SelectRange("a1").FormulaR1C1 = Chr(i) & Chr(j) & _Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)Exit SubEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextEnd Sub破解excel工作表密码和单元格保护密码在日常工作中,您是否遇到过这样的情况:您用Excel编制的报表、表格、程序等,在单元格中设置了公式等,为了防止其他人修改您的设置或者防止您自己无意中修改,您可能会使用Excel的工作表保护功能,但护密码容易忘记,这该怎么办?有时您从网上下载的Excel格式的小程序,您想修改,但是作者加了工作表保怎么办?您只要按照以下步骤操作,Excel工作表保护密码瞬间即破!1、打开您需要破解保护密码的Excel文件;2、依次点击菜单栏上的工具---宏----录制新宏,输入宏名字如:aa;3、停止录制(这样得到一个空宏);4、依次点击菜单栏上的工具---宏----宏,选aa,点编辑按钮;5、删除窗口中的所有字符(只有几个),替换为下面的内容;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 passwordsConst DBLSPACE As String = vbNewLine & vbNewLineConst 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 & VERSIONConst MSGNOPWORDS2 As String = "There was no protection to " & _ "workbook structure or windows." & DBLSPACE & _"Proceeding to unprotect sheets." & AUTHORS & VERSIONConst 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 & VERSIONConst MSGONLYONE As String = "Only structure / windows " & _ "protected with the password that was just found." & _ALLCLEAR & AUTHORS & VERSION & REPBACKDim w1 As Worksheet, w2 As WorksheetDim i As Integer, j As Integer, k As Integer, l As IntegerDim m As Integer, n As Integer, i1 As Integer, i2 As IntegerDim i3 As Integer, i4 As Integer, i5 As Integer, i6 As IntegerDim PWord1 As StringDim ShTag As Boolean, WinTag As BooleanApplication.ScreenUpdating = FalseWith ActiveWorkbookWinTag = .ProtectStructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 In WorksheetsShTag = ShTag Or w1.ProtectContentsNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWORDS1, vbInformation, HEADERExit SubEnd IfMsgBox MSGTAKETIME, vbInformation, HEADERIf Not WinTag ThenMsgBox MSGNOPWORDS2, vbInformation, HEADERElseOn Error Resume NextDo 'dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66With 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 ThenPWord1 = 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, HEADERExit Do 'Bypass all for...nextsEnd IfEnd WithNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfIf WinTag And Not ShTag ThenMsgBox MSGONLYONE, vbInformation, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In Worksheets'Attempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets'Checks for all clear ShTag triggered to 1 if not.ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith w1If .ProtectContents ThenOn Error Resume NextDo 'Dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For 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.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 ThenPWord1 = 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, HEADERleverage finding Pword by trying on other sheetsFor Each w2 In Worksheetsw2.Unprotect PWord1Next w2Exit Do 'Bypass all for...nextsEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfEnd WithNext w1End IfMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADEREnd Sub6、关闭编辑窗口;7、依次点击菜单栏上的工具---宏-----宏,选AllInternalPasswords,运行,确定两次;等一会,再点击确定。

ExcelVBA破解工作表工作簿保护密码

ExcelVBA破解工作表工作簿保护密码

ExcelVBA破解工作表工作簿保护密码Excel VBA破解工作表/工作簿保护密码平时在用Excel编辑文件时,如果不希望别人修改文件的内容,我们一般会为工作表或工作簿添加上密码,起到保护作用。

而当我们从网上下载了一个Excel文档,如果里面带有工作表/工作簿密码保护,我们又急需修改这个文件,这时我们又该怎么办呢?今天,我们就来讲一下Excel工作表/工作簿密码的攻与防,正所谓没有最硬的盾,也没有最快的矛,矛与盾的关系就看我们怎么处理了。

好了,闲话少说,打板就唱。

怎么样设置工作表/工作簿密码?制作好Excel表后,点击工具菜单下的保护->保护工作表/保护工作簿,在弹出的对话框中设置上密码即可。

密码尽量设置的复杂点,防止暴力破解。

到此,工作表/工作簿密码就设置好了,下面我们就开始讲怎么破解这个密码。

怎么样破解这个密码?注意:在破解之前最好先备份,免得发生意外!破解密码,一般人都会想到用软件来破解,而我们今天是用VBA 来进行破解。

首先打开VBA编辑器。

1、点击工具->宏->Visual Basic编辑器,打开VBA的编辑器。

2、在Visual Basic编辑器中,点击插入->模块,插入一个新的模块,我们的代码就是写到这个新的模块中的。

5、程序开始运行后,会弹出两次对话框,直接确定即可。

6、大约2分钟左右后,即弹出完成对话框,下图中画红线的地方即是找到的密码(注意:最后的那个也是密码中的一部分),单击确定后,文件中的密码即被清除。

7、如果只想找到密码而不想清除它,只要不保存文件,重新打开后在工具->保护->撤消工作表/工作簿保护,输入刚才找到的密码即可。

8、需要说明的一点是,找到的这个密码并不是真正设置时输入的密码,但确可以使用。

比如刚才找到的这个密码,而我设置时用的是123为密码的,不知这种情况是Excel的漏洞还是有意为之的,总之都可以撤消对工作表的保护。

总结看到这里,我们要问了,那怎么样的密码才算安全呀?其实安全是需要配合使用的,我们刚才的代码只是破解工作表/工作簿密码的,而我们可以用更多其它方面的保护来防止我们的文件不被破解,比如权限的设置(文件->权限)等。

EXCEL工作表密码保护的解除方法

EXCEL工作表密码保护的解除方法

Excel工作表密码保护的解除方法Excel弹出“您试图更改的单元格或图表受保护,因而是只读的;若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令在‘审阅’选项卡的‘更改’组中来取消保护;可能会提示您输入密码;出现这种情况,应该怎么解决呢经过研究,找到了两种破解Excel工作表保护码的方法;一、VBA宏代码破解法:第一步:打开该文件第二步:按Alt F11,进入VBA编辑界面;第三步:插入一个Module;第四步:在右边Module的空白编辑区域,复制粘贴下面的所有内容;第五步:按F5,运行该VBA命令;密码就现形了;Sub PasswordDim i As Integer, j As Integer, k As IntegerDim l As Integer, m As Integer, n As IntegerDim i1 As Integer, i2 As Integer, i3 As IntegerDim i4 As Integer, i5 As Integer, i6 As IntegerOn Error Resume NextFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126ActiveSheet.Unprotect Chri & Chrj & Chrk & _Chrl & Chrm & Chri1 & Chri2 & Chri3 & _Chri4 & Chri5 & Chri6 & ChrnIf ActiveSheet.ProtectContents = False ThenMsgBox "One usable password is " & Chri & Chrj & _Chrk & Chrl & Chrm & Chri1 & Chri2 & _Chri3 & Chri4 & Chri5 & Chri6 & ChrnActiveWorkbook.Sheets1.SelectRange"a1".FormulaR1C1 = Chri & Chrj & _Chrk & Chrl & Chrm & Chri1 & Chri2 & _Chri3 & Chri4 & Chri5 & Chri6 & ChrnExit SubEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextEnd Sub第六步:切换“审阅”选项卡,点击“撤消工作表保护”,然后输入密码即可解除锁定;二、软件破解法有许多专门为破解Excel各种密码而制作的软件,Excel Key与AdvancedOffice Password Recovery就是其中的佼佼者;它们的使用方法简单且破解速度极快;1. Excel Key下载下载地址:http://.mydown/soft/183/183131.html安装完后运行软件,点击工具栏“Recovery”按钮,找到要破解的文件,软件马上就可以解出密码了图5;2. Advanced Office Password Recovery下载下载地址:http://.mydown/soft/utilitie/security/268/410768.shtml 安装完后运行软件,点击工具栏“Open File”按钮,打开要破解的Excel文件,马上就可以看到解出的密码了图6;可以看出,用以上方法读出的密码完全不同,但它们确实均可以解除该工作表的密码保护,这实在是个有趣的问题;在网上查找了许久,终于找到比较圆满的解释答案:当Excel工作表采用密码保护时,就会生成一个16位双字节长hash值;当输入密码进行验证时,真正进行比较的就是这个hash值;事实上,有很多不同的密码都可以生成同样的hash值;大家可以试试:当你用“test”不含双引号作为Excel工作表保护密码,你同样可以用“zzyw”同样不含双引号这个密码进行解锁;怎么样,神奇吧。

vba撤销保护工作表

vba撤销保护工作表

vba撤销保护工作表VBA撤销保护工作表是微软VBA编程语言中的一种常用操作。

这种操作能够有效地帮助用户恢复被保护的Excel 工作表的编辑权限,从而使得用户可以进行必要的修改和编辑工作。

在本文中,我们将从以下三个方面来介绍VBA 撤销保护工作表的操作。

一、VBA撤销保护工作表的基本操作首先,我们需要了解一些关于VBA撤销保护工作表的基本操作。

在VBA中,我们通常使用Unprotect方法来撤销Excel工作表的保护。

具体来说,我们需要首先打开Excel工作表,然后进入VBA编辑器。

接着,我们需要在VBA编辑器中输入以下代码并执行,即可取消该工作表的保护:Sub UnprotectSheet () ActiveSheet.Unprotect Password:="password" End Sub在这段代码中,我们使用了ActiveSheet.Unprotect 方法来撤销当前激活的工作表的保护。

同时,我们也需要在代码中输入一个密码(这里的密码是一个字符串常量),以确保只有知道密码的人才可以进行保护或撤销保护操作。

二、VBA撤销保护工作表的注意事项当执行VBA撤销保护工作表的操作时,我们需要注意一些事项,以确保操作的成功。

首先,我们需要确保正在撤销保护的工作表确实是需要进行编辑的工作表。

如果不确定当前的工作表是否需要撤销保护,我们可以使用IsProtected方法来判断该工作表是否被保护。

代码如下:Sub CheckIfProtected () IfActiveSheet.ProtectContents = True Then MsgBox "The sheet is protected." Else MsgBox "The sheet is not protected." End If在这段代码中,如果正在激活的工作表被保护,那么将会弹出一个提示框,提示用户该工作表已经被保护。

如何撤销工作表保护

如何撤销工作表保护

如何撤销工作表保护首先,打开Excel文件,找到你需要撤销保护的工作表。

然后,点击工具栏上的“审阅”选项卡,在“审阅”选项卡中找到“保护工作表”按钮。

在弹出的下拉菜单中,选择“撤销工作表保护”。

接着,系统会提示你输入工作表的密码,如果当初设置了密码的话。

输入正确的密码后,点击“确定”按钮即可完成工作表保护的撤销。

如果你忘记了当初设置的密码,那么就需要使用其他方法来撤销工作表保护了。

在这种情况下,你可以尝试以下方法:首先,复制下面的VBA代码:Sub UnprotectSheet()。

Dim ws As Worksheet。

For Each ws In Worksheets。

ws.Unprotect Password:="YourPassword"Next ws。

End Sub。

然后,按下“Alt + F11”打开VBA编辑器,在左侧的项目资源管理器中找到你的工作簿,双击打开它,然后在弹出的窗口中粘贴上面复制的VBA代码。

接着,替换代码中的“YourPassword”为你当初设置的密码,然后按下“F5”执行代码。

这样就可以撤销工作表的保护了。

除了使用VBA代码来撤销工作表保护外,你还可以尝试将工作表复制到一个新的工作簿中。

在新的工作簿中,工作表的保护将被自动撤销,这样你就可以对其进行修改了。

总的来说,撤销工作表保护并不复杂,只需要按照上述步骤进行操作即可。

无论是通过Excel自带的功能,还是通过VBA代码,都可以轻松实现对工作表保护的撤销。

希望以上内容对你有所帮助,谢谢阅读!。

Excel VBA撤销工作表保护密码

Excel VBA撤销工作表保护密码
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
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, _
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
5、删除窗口中的所有字符(只有几个),替换为下面的内容;
Public Sub 工作表保护密码破解()
Const DBLSPACE As String = vbNewLine & vbNewLine
Const AUTHORS As String = DBLSPACE & vbNewLine & _
"$$", PWord1), vbInformation, HEADER

用VBA代码取消EXCELVBA工程密码保护

用VBA代码取消EXCELVBA工程密码保护

用VBA代码取消EXCELVBA工程密码保护Excel VBA密码破解工具(VBA实现)使用UltreEdit之类的十六进制编辑程序打开.XLS文件,在文本模式下查找“[Host Extender Info]”(也可只查Host),切换到十六进制模式,将前面的“DBP="XXXXXXX...”的DBP关键字改成CBP,将“GC="XXXXXXX...”的GC关键字改成CC,使Excel不能识别此二项!存盘即可用Excel打开此文件,忽略错误提示,进入VBA编辑器,嘿嘿,密码没有了!做一次存盘操作即可修复错误提示。

--------------------------------------------------------------------------------在很多地方我都说过,Excel VBA的工程密码是很脆弱的,其实很早就有一篇这样的贴子,我也将其整理为加载宏不过还是有很多朋友在问:)。

现将主程序的源代码也整理于此。

使用者只用把以下的代码COPY到一个空的工作表的模块里,再运行MoveProtect() 就可以解除VBA保护的限制。

'1>一段极好的VBA保护密码破解程序测试WIN98+OFFICE97破解率100%'2>用以下代码对VBA加密保护后用offkey 6.5-7.0及Advanced VBA pASSWORD Recovery专业版均无法破解出保护程式码的密码'移除VBA编码保护'--------------------------------------------------------------------------------'移除工作表VBA保护Sub MoveProtect()Dim FileName As StringFileName = Application.GetOpenFilename("Excel文件(*.xls & *.xla),*.xls;*.xla", , "VBA破解")If FileName = CStr(False) ThenExit SubElseVBAPassword FileName, FalseEnd IfEnd Sub'--------------------------------------------------------------------------------'设置VBA编码保护Sub SetProtect()Dim FileName As StringFileName = Application.GetOpenFilename("Excel文件(*.xls & *.xla),*.xls;*.xla", , "VBA破解")If FileName = CStr(False) ThenExit SubElseVBAPassword FileName, TrueEnd IfEnd Sub'--------------------------------------------------------------------------------Private Function VBAPassword(FileName As String, Optional Protect As Boolean = False)If Dir(FileName) = "" ThenExit FunctionElseFileCopy FileName, FileName & ".bak"End IfDim GetData As String * 5Open FileName For Binary As #1Dim CMGs As LongDim DPBo As LongFor i = 1 To LOF(1)Get #1, i, GetDataIf GetData = "CMG=""" Then CMGs = iIf GetData = "[Host" Then DPBo = i - 2: Exit ForNextIf CMGs = 0 ThenMsgBox "请先对VBA编码设置一个保护密码...", 32, "提示" Exit FunctionEnd IfIf Protect = False ThenDim St As String * 2Dim s20 As String * 1'取得一个0D0A十六进制字串Get #1, CMGs - 2, St'取得一个20十六制字串Get #1, DPBo + 16, s20'替换加密部份机码For i = CMGs To DPBo Step 2Put #1, i, StNext'加入不配对符号If (DPBo - CMGs) Mod 2 <> 0 ThenPut #1, DPBo + 1, s20End IfMsgBox "文件解密成功......", 32, "提示"ElseDim MMs As String * 5MMs = "DPB="""Put #1, CMGs, MMsMsgBox "对文件特殊加密成功......", 32, "提示"End IfClose #1End Function以上代码经XP SP2,OFFICE EXCEL 2003验证成功。

office文件密码移除的方法

office文件密码移除的方法

office文件密码移除的方法Office文件密码移除的方法在我们处理Office文件时,有时会设置密码来保护文件的安全性,但是如果忘记了密码,就会导致文件无法打开甚至丧失,这对于工作和生活都会带来很大的困扰。

现在,我们提供几种Office文件密码移除的方法,帮助您解决文件密码问题。

一、通过VBA代码删除密码1. 打开受密码保护的Office文件,按下“Alt+F11”键,进入VBA编辑器界面;2. 在左侧的“项目”面板中,找到受保护的文档文件夹,并打开“Microsoft Office Word Objects”;3. 双击打开该文件夹下的“ThisDocument”,在代码编辑器中输入以下代码:Sub RemovePassword()Dim oProtection As Office.DocumentPropertiesSet oProtection = ActiveDocument.DocumentPropertiesoProtection.Remove ("Password")End Sub4. 点击“F5”或手动运行代码,即可将文档中的密码移除。

注:这种方法需要一定的编程能力,对于新手用户相对较为复杂。

二、通过在线免费解密网站破解密码1. 打开在网上搜索的一款免费在线Office密码解除工具,例如“iSumsoft Online Password Remover”;2. 点击“选择文件”或“上传”按钮,选择需要解密的文档;3. 输入文档密码,点击“解锁”等解密按钮,等待软件解密后就能解除文档密码了。

注:这种方法需要保证使用的密码解除网站安全可靠,同时也需要保护个人隐私,避免泄露。

三、通过第三方软件破解密码1. 下载并安装一款Office密码破解软件,例如“Apeaksoft Word Password Recovery”;2. 启动软件,并选择需要解密的文档,点击“开始扫描”按钮;3. 等待扫描完成后,系统会显示用于解锁文件的密码,再输入密码并点击解锁按钮即可完成密码移除。

Excel密码保护的解除方法与解除原理

Excel密码保护的解除方法与解除原理

Excel密码保护的解除方法与解除原理2010-06-22 20:21Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。

若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。

可能会提示您输入密码。

”窗口,如图1。

出现这种情况,应该怎么解决呢?经过研究,找到了两种破解Excel工作表保护码的方法。

一、VBA宏代码破解法:第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮,打开“Microsoft Office安全选项”窗口,选择其中的“启用此内容”,“确定”退出(图2);再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:PasswordBreaker(图3),点击“确定”退出;第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,打开“MicrosoftVisualBasic”编辑器,用如下内容替换右侧窗口中的所有代码:Sub PasswordBreaker()Dim i As Integer, j As Integer, k As IntegerDim l As Integer, m As Integer, n As IntegerDim i1 As Integer, i2 As Integer, i3 As IntegerDim i4 As Integer, i5 As Integer, i6 As IntegerOn Error Resume NextFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For 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 ActiveSheet.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 ActiveSheet.ProtectContents = False ThenMsgBox "One usable password is " & Chr(i)& Chr(j) & _Chr(k) & Chr(l) & Chr(m)& Chr(i1) & Chr(i2)& _Chr(i3) & Chr(i4) & Chr(i5)& Chr(i6) & Chr(n)ActiveWorkbook.Sheets(1).SelectRange("a1").FormulaR1C1 = Chr(i) & Chr(j)& _Chr(k) & Chr(l) & Chr(m)& Chr(i1) & Chr(i2)& _Chr(i3) & Chr(i4) & Chr(i5)& Chr(i6) & Chr(n)Exit SubEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextEnd Sub第三步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“执行”,密码就现形了(图4)。

excel工作表保护破解

excel工作表保护破解

excel工作表保护破解Excel工作表保护破解。

在日常工作中,我们经常会使用Excel表格来存储和处理数据。

为了保护数据的安全性,我们经常会对Excel工作表进行保护。

但有时候我们会遇到需要修改或编辑被保护的工作表的情况,这就需要我们学会如何破解Excel工作表的保护。

破解Excel工作表保护并不是一件复杂的事情,下面我将向大家介绍几种常用的方法。

第一种方法是通过VBA代码来破解Excel工作表保护。

首先,我们需要按下Alt + F11组合键,打开VBA编辑器。

然后在新建的模块中输入以下代码:Sub UnprotectSheet()。

Dim ws As Worksheet。

For Each ws In ThisWorkbook.Worksheets。

ws.Unprotect Password:="yourpassword"Next ws。

End Sub。

在上面的代码中,yourpassword是你设置的工作表保护密码。

执行完上述代码后,所有工作表的保护都会被解除。

第二种方法是通过在线工具来破解Excel工作表保护。

有一些在线工具可以帮助我们破解Excel工作表的保护,例如LostMyPass、Password-Find等。

我们只需要上传被保护的Excel文件,这些工具就可以帮我们破解保护密码。

第三种方法是通过修改Excel文件的扩展名来破解Excel工作表保护。

我们可以将Excel文件的扩展名修改为.zip,然后解压缩这个压缩文件。

在解压缩后的文件夹中,我们可以找到xl目录,里面包含了workbook.xml和worksheets文件夹。

我们可以用记事本打开workbook.xml文件,找到<workbookProtection>节点,将其删除或者修改为<workbookProtection lockStructure="0" lockWindows="0"/>,然后保存文件。

EXCEL密码保护用宏破解

EXCEL密码保护用宏破解

Excel,VBA宏破解的方法,步骤如下:1.点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:PasswordBreaker,点击“确定”退出;2.再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,打开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码:Sub PasswordBreaker()Dim i As Integer, j As Integer, k As IntegerDim l As Integer, m As Integer, n As IntegerDim i1 As Integer, i2 As Integer, i3 As IntegerDim i4 As Integer, i5 As Integer, i6 As IntegerOn Error Resume NextFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126ActiveSheet.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 ActiveSheet.ProtectContents = False ThenMsgBox "One usable password is " & Chr(i) & Chr(j) & _Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)ActiveWorkbook.Sheets(1).SelectRange("a1").FormulaR1C1 = Chr(i) & Chr(j) & _Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)Exit SubEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextEnd Sub3.再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“执行”,密码就现形了。

移除VBA密码

移除VBA密码

'移除VBA编码保护Sub MoveProtect()Dim FileName As StringFileName = Application.GetOpenFilename("Excel文件(*.xls & *.xla),*.xls;*.xla", , "VBA 破解")If FileName = CStr(False) ThenExit SubElseVBAPassword FileName, FalseEnd IfEnd Sub'设置VBA编码保护Sub SetProtect()Dim FileName As StringFileName = Application.GetOpenFilename("Excel文件(*.xls & *.xla),*.xls;*.xla", , "VBA 破解")If FileName = CStr(False) ThenExit SubElseVBAPassword FileName, TrueEnd IfEnd SubPrivate Function VBAPassword(FileName As String, Optional Protect As Boolean = False) If Dir(FileName) = "" ThenExit FunctionElseFileCopy FileName, FileName & ".bak"End IfDim GetData As String * 5Open FileName For Binary As #1Dim CMGs As LongDim DPBo As LongFor i = 1 To LOF(1)Get #1, i, GetDataIf GetData = "CMG=""" Then CMGs = iIf GetData = "[Host" Then DPBo = i - 2: Exit ForNextIf CMGs = 0 ThenMsgBox "请先对VBA编码设置一个保护密码...", 32, "提示"Exit FunctionEnd IfIf Protect = False ThenDim St As String * 2Dim s20 As String * 1'取得一个0D0A十六进制字串Get #1, CMGs - 2, St'取得一个20十六制字串Get #1, DPBo + 16, s20'替换加密部份机码For i = CMGs To DPBo Step 2Put #1, i, StNext'加入不配对符号If (DPBo - CMGs) Mod 2 <> 0 ThenPut #1, DPBo + 1, s20End IfMsgBox "文件解密成功......", 32, "提示"ElseDim MMs As String * 5MMs = "DPB="""Put #1, CMGs, MMsMsgBox "对文件特殊加密成功......", 32, "提示"End IfClose #1End Function本文来自CSDN博客,转载请标明出处:/zhongchengli/archive/2011/01/06/6120090.aspx。

Excel表格密码保护的解除方法

Excel表格密码保护的解除方法

E x c e l表格密码保护的解除方法(总2页)-CAL-FENGHAI.-(YICAI)-Company One1-CAL-本页仅作为文档封面,使用请直接删除Excel表格密码保护的解除方法表格受密码保护时,我们修改数据Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。

若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。

可能会提示您输入密码。

这时候我们可以用VBA 宏代码破解法来破解表格保护密码:第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮,打开“Microsoft Office安全选项”窗口,选择其中的“启用此内容”,“确定”。

再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:PasswordBreaker,点击“确定”退出;第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,打开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码:Sub PasswordBreaker()Dim i As Integer, j As Integer, k As IntegerDim l As Integer, m As Integer, n As IntegerDim i1 As Integer, i2 As Integer, i3 As IntegerDim i4 As Integer, i5 As Integer, i6 As IntegerOn Error Resume NextFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126Chr(i) & Chr(j) & Chr(k) & _Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)If = False ThenMsgBox "One usable password is " & Chr(i) & Chr(j) & _Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)(1).SelectRange("a1").FormulaR1C1 = Chr(i) & Chr(j) & _Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)Exit SubEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextEnd Sub第三步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“执行”,密码就现形了第四步:点击“撤消工作表保护”,然后输入密码即可解除锁定;测试结果,密码破解可用,但是很晕的是破解的密码跟原来的密码有很大的差距,想不明白了,反正能用就好。

Excel用VBA去除工作表保护密码

Excel用VBA去除工作表保护密码

Excel用VBA去除工作表保护密码Excel 的工作表保护是非常脆弱的。

下面的VBA代码虽然不能找出工作表保护密码,但可以取消工作表保护,如果自己的工作表保护密码忘记了,可以用这个方法:1.按Alt+F11,打开VBA编辑器。

2.在“工程”窗口中选择要取消保护的工作表名称,单击菜单“插入→模块”。

3.在右侧的代码窗口中输入下列代码:Sub Remove_WorkSheet_Password()Dim i As Integer, j As Integer, k As IntegerDim l As Integer, m As Integer, n As IntegerDim i1 As Integer, i2 As Integer, i3 As IntegerDim i4 As Integer, i5 As Integer, i6 As IntegerOn Error Resume NextIf ActiveSheet.ProtectContents = False ThenMsgBox "该工作表没有保护密码!"Exit SubEnd IfFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126ActiveSheet.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 ActiveSheet.ProtectContents = False ThenMsgBox "已经解除了工作表保护!"Exit SubEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextEnd Sub4.关闭VBA编辑器,回到工作表中,按Alt+F8,打开“宏”对话框,选择“Remove_WorkSheet_Password”,并单击“执行”按钮。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

移除Excel文档VBA编码保护新建一个Excel工作簿,Alt+F11 打开VBA编辑器,新建一个模块 ,复制以下代码,注意如提示变量未定义,则把Option Explicit行删除即可,经测试已经通过.'移除VBA编码保护Sub MoveProtect()Dim FileName As StringFileName = Application.GetOpenFilename("Excel文件(*.xls & *.xla),*.xls;*.xla", , "VBA破解")If FileName = CStr(False) ThenExit SubElseVBAPassword FileName, FalseEnd IfEnd Sub'设置VBA编码保护Sub SetProtect()Dim FileName As StringFileName = Application.GetOpenFilename("Excel文件(*.xls & *.xla),*.xls;*.xla", , "VBA破解")If FileName = CStr(False) ThenExit SubElseVBAPassword FileName, TrueEnd IfEnd SubPrivate Function VBAPassword(FileName As String, Optional Protect As Boolean = False)If Dir(FileName) = "" ThenExit FunctionElseFileCopy FileName, FileName & ".bak"End IfDim GetData As String * 5Open FileName For Binary As #1Dim CMGs As LongDim DPBo As LongFor i = 1 To LOF(1)Get #1, i, GetDataIf GetData = "CMG=""" Then CMGs = iIf GetData = "[Host" Then DPBo = i - 2: Exit ForNextIf CMGs = 0 ThenMsgBox "请先对VBA编码设置一个保护密码...", 32, "提示" Exit FunctionEnd IfIf Protect = False ThenDim St As String * 2Dim s20 As String * 1'取得一个0D0A十六进制字串Get #1, CMGs - 2, St'取得一个20十六制字串Get #1, DPBo + 16, s20'替换加密部份机码For i = CMGs To DPBo Step 2Put #1, i, StNext'加入不配对符号If (DPBo - CMGs) Mod 2 <> 0 ThenPut #1, DPBo + 1, s20End IfMsgBox "文件解密成功......", 32, "提示"ElseDim MMs As String * 5MMs = "DPB="""Put #1, CMGs, MMsMsgBox "对文件特殊加密成功......", 32, "提示"End IfClose #1End FunctionEXCEL宏保护密码破解-VBA工程密码破解-vba密码破解EXCEL工程密破解,以下方法十分有效的帮你打开VBA工程密码保护的工程,教你破解VBA工程密码,解除VBA工程密码保护下的EXCEL文档,破解EXCEL原来如此简单.--------------在办公中我们常看到许多用宏(VBA)编写的EXCEL表格,而这些表格就如同一个数据库,我们可以选取或查询很多的数据,一般的这些数据是存放在一个隐藏的工作表中的,那么要如何显示这个隐藏的工作表呢?我们可以打开宏编辑器(ALT+F11),再安CTRL+R打开专案,这时弹出窗会有所有的这个EXCEL的工用表,这时你就可以看看那些是被隐藏的了,很多时候打开是需要密码的,用以下方法解密后,再将解密后文件打开,依同样方法在工作表标签中右键>>检视程式码>>复制以下代码>>按F8执行Private Sub CommandButton1_Click()Worksheets("这里为你要显示的工作表名称").Visible = TrueEnd Sub关于破解EXCEL VBA工程密码的方法,以下代码非常有效,首先建一新EXCEL文件,在工作表标签处右点>>检视程式码>>复制以下代码>>按F8执行在弹出窗中选你要你破解工程密码的EXCEL文件 >>再按F5执行即可.Private Sub VBAPassword()'你要解保护的Excel文件路径Filename = Application.GetOpenFilename("Excel文件(*.xls & *.xla & *.xlt),*.xls;*.xla;*.xlt", , "VBA破解")If Dir(Filename) = "" ThenMsgBox "没找到相关文件,清重新设置。

"Exit SubElseFileCopy Filename, Filename & ".bak" '备份文件。

End IfDim GetData As String * 5Open Filename For Binary As #1Dim CMGs As LongDim DPBo As LongFor i = 1 To LOF(1)Get #1, i, GetDataIf GetData = "CMG=""" Then CMGs = iIf GetData = "[Host" Then DPBo = i - 2: Exit ForNextIf CMGs = 0 ThenMsgBox "请先对VBA编码设置一个保护密码...", 32, "提示"Exit SubEnd IfIf Protect = False ThenDim St As String * 2Dim s20 As String * 1'取得一个0D0A十六进制字串Get #1, CMGs - 2, St'取得一个20十六制字串Get #1, DPBo + 16, s20'替换加密部份机码For i = CMGs To DPBo Step 2Put #1, i, StNext'加入不配对符号If (DPBo - CMGs) Mod 2 <> 0 ThenPut #1, DPBo + 1, s20End IfMsgBox "文件解密成功......", 32, "提示"End IfClose #1End Sub如果上面代码不能运行或出错,请用以下代码重试.Private Sub VBAPassword()'你要解保护的Excel文件路径Filename = Application.GetOpenFilename("Excel文件(*.xls & *.xla & *.xlt),*.xls;*.xla;*.xlt", , "VBA破解")If Dir(Filename) = "" ThenMsgBox "没找到相关文件,清重新设置。

"Exit SubElseFileCopy Filename, Filename & ".bak" '备份文件。

End IfDim GetData As String * 5Open Filename For Binary As #1Dim CMGs As LongDim DPBo As LongFor i = 1 To LOF(1)Get #1, i, GetDataIf GetData = "CMG=""" Then CMGs = iIf GetData = "[Host" Then DPBo = i - 2: Exit ForNextIf CMGs = 0 ThenMsgBox "请先对VBA编码设置一个保护密码...", 32, "提示" Exit SubEnd IfDim St As String * 2Dim s20 As String * 1'取得一个0D0A十六进制字串Get #1, CMGs - 2, St'取得一个20十六制字串Get #1, DPBo + 16, s20'替换加密部份机码For i = CMGs To DPBo Step 2Put #1, i, StNext'加入不配对符号If (DPBo - CMGs) Mod 2 <> 0 ThenPut #1, DPBo + 1, s20End IfMsgBox "文件解密成功......", 32, "提示"Close #1End Sub。

相关文档
最新文档