㈠ 如何破解excel宏的保護密碼
第一步:打開該文件,先解除默認的「宏禁用」狀態,方法是點擊工具欄下的「選項」狀態按鈕,打開「MicrosoftOffice安全選項」窗口,選擇其中的「啟用此內容」,「確定」退出;
第四步:切換「審閱」選項卡,點擊「撤消工作表保護」,然後輸入密碼即可解除鎖定。
㈡ 如何破解excel宏密碼的方法
Sub VBAPassword() '你要解保護的Excel文件路徑
Filename = Application.GetOpenFilename("Excel文件(*.xls & *.xla & *.xlt),*.xls;*.xla;*.xlt", , "VBA密碼破解")
If Dir(Filename) = "" Then
MsgBox "沒找到相關文件,請重新設置。"
Exit Sub
Else
FileCopy Filename, Filename & ".bak" '備份文件。
End If
Dim GetData As String * 5
Open Filename For Binary As #1
Dim CMGs As Long
Dim DPBo As Long
For i = 1 To LOF(1)
Get #1, i, GetData
If GetData = "CMG=""" Then CMGs = i
If GetData = "[Host" Then DPBo = i - 2: Exit For
Next
If CMGs = 0 Then
MsgBox "請先對VBA編碼設置一個保護密碼...", 32, "提示"
Exit Sub
End If
Dim St As String * 2
Dim s20 As String * 1
'取得一個0D0A十六進制字串
Get #1, CMGs - 2, St
'取得一個20十六制字串
Get #1, DPBo + 16, s20
'替換加密部份機碼
For i = CMGs To DPBo Step 2
Put #1, i, St
Next
'加入不配對符號
If (DPBo - CMGs) Mod 2 <> 0 Then
Put #1, DPBo + 1, s20
End If
MsgBox "文件解密成功......", 32, "提示"
Close #1
End Sub
㈢ Excel中的xlsm宏密碼怎麼破解
首先,先去下載一款代碼編輯器Notepad++
最後,保存後關閉檔案,重新打開檔案就可以看到裡面的代碼了
PS. 破解僅用來學習,但不要擋了別人的財路
㈣ 如何解鎖excel密碼的教程
在 Excel 中錄入過多的重要數據是大家的習慣,為了不讓Execl數據被他人隨意篡改都需要進行密碼保護,但有時候卻忘記了密碼,這個時候就需要解鎖密碼了。下面是我帶來的關於如何解鎖excel密碼的教程,歡迎閱讀!
如何解鎖excel密碼的教程:
解鎖密碼步驟1:如果Excel文件的打開密碼忘記了,且密碼是6位數以內的數字,可用以下步驟解開(關掉所有程序,為了速度):
解鎖密碼步驟2:新開一Excel,同時按Alt和F11,進入VBA界面,點菜單上的插入,模塊,在新出來的窗口粘貼一下代碼:
Sub crack()
Dim i As Long
Dim FileName As String
i = 0
FileName = Application.GetOpenFilename("Excel文件(*.xls & *.xlsx),*.xls;*.xlsx", , "VBA破解")
FileName = Right(FileName, Len(FileName) - InStrRev(FileName, ""))
Application.ScreenUpdating = False
line2: On Error GoTo line1
Workbooks.Open FileName, , True, , i
MsgBox "Password is " & i
Exit Sub
line1: i = i + 1
Resume line2
Application.ScreenUpdating = True
End Sub
解鎖密碼步驟3:然後在此界面直接按F5運行此宏,選擇文件,等啊等(看密碼長度了)
㈤ 如何破解excel宏密碼的方法
EXCEL工程密破解,以下方法十分有效的幫你打開VBA工程密碼保護的工程,教你破解VBA工程密碼,解除VBA工程密碼保護下的EXCEL文檔,破解EXCEL原來如此簡單.--------------在辦公中我們常看到許多用宏(VBA)編寫的EXCEL表格,而這些表格就如同一個資料庫,我們可以選取或查詢很多的數據,一般的這些數據是存放在一個隱藏的工作表中的,那麼要如何顯示這個隱藏的工作表呢?我們可以打開宏編輯器(ALT+F11),再安CTRL+R打開專案,這時彈出窗會有所有的這個EXCEL的工用表,這時你就可以看看那些是被隱藏的了,很多時候打開是需要密碼的,用以下方法解密後,再將解密後文件打開,依同樣方法在工作表標簽中右鍵>>檢視程式碼>>復制以下代碼>>按F8執行
Private Sub CommandButton1_Click()
Worksheets("這里為你要顯示的工作表名稱").Visible = True
End 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) = "" Then
MsgBox "沒找到相關文件,清重新設置。"
Exit Sub
Else
FileCopy Filename, Filename & ".bak" '備份文件。
End If
Dim GetData As String * 5
Open Filename For Binary As #1
Dim CMGs As Long
Dim DPBo As Long
For i = 1 To LOF(1)
Get #1, i, GetData
If GetData = "CMG=""" Then CMGs = i
If GetData = "[Host" Then DPBo = i - 2: Exit For
Next
If CMGs = 0 Then
MsgBox "請先對VBA編碼設置一個保護密碼...", 32, "提示"
Exit Sub
End If
If Protect = False Then
Dim St As String * 2
Dim s20 As String * 1
'取得一個0D0A十六進制字串
Get #1, CMGs - 2, St
'取得一個20十六制字串
Get #1, DPBo + 16, s20
'替換加密部份機碼
For i = CMGs To DPBo Step 2
Put #1, i, St
Next
'加入不配對符號
If (DPBo - CMGs) Mod 2 <> 0 Then
Put #1, DPBo + 1, s20
End If
MsgBox "文件解密成功......", 32, "提示"
End If
Close #1
End Sub
如果上面代碼不能運行或出錯,請用以下代碼重試.
Private Sub VBAPassword()
'你要解保護的Excel文件路徑
Filename = Application.GetOpenFilename("Excel文件(*.xls & *.xla & *.xlt),*.xls;*.xla;*.xlt", , "VBA破解")
If Dir(Filename) = "" Then
MsgBox "沒找到相關文件,清重新設置。"
Exit Sub
Else
FileCopy Filename, Filename & ".bak" '備份文件。
End If
Dim GetData As String * 5
Open Filename For Binary As #1
Dim CMGs As Long
Dim DPBo As Long
For i = 1 To LOF(1)
Get #1, i, GetData
If GetData = "CMG=""" Then CMGs = i
If GetData = "[Host" Then DPBo = i - 2: Exit For
Next
If CMGs = 0 Then
MsgBox "請先對VBA編碼設置一個保護密碼...", 32, "提示"
Exit Sub
End If
Dim St As String * 2
Dim s20 As String * 1
'取得一個0D0A十六進制字串
Get #1, CMGs - 2, St
'取得一個20十六制字串
Get #1, DPBo + 16, s20
'替換加密部份機碼
For i = CMGs To DPBo Step 2
Put #1, i, St
Next
'加入不配對符號
If (DPBo - CMGs) Mod 2 <> 0 Then
Put #1, DPBo + 1, s20
End If
MsgBox "文件解密成功......", 32, "提示"
Close #1
End Sub
VBA代碼引用自:
㈥ Excel宏加密後,無論創建、刪除還是編輯均需密碼,如何破解
1、我新建一個excel文件(.xlsx格式的)來測試破解過程,其它文件可以參考,但最好要備份原來的文件,設置工作表、工作薄為密碼保護,保存後
㈦ 如何破解excel宏密碼的方法
如何破解excel宏密碼的方法:
破解宏密碼步驟1:打開需要破解的文件,並點開需要輸入密碼的界面,如圖
㈧ 如何破解Excel宏密碼
方法:
1\打開文件
2\工具---宏----錄制新宏---輸入名字如:aa
3\停止錄制(這樣得到一個空宏)
4\工具---宏----宏,選aa,點編輯按鈕
5\刪除窗口中的所有字元(只有幾個),替換為下面的內容:(復制吧)
6\關閉編輯窗口
7\工具---宏-----宏,選AllInternalPasswords,運行,確定兩次,等2分鍾,再確定.OK,沒有密碼了!!
內容如下:
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 'mmy 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