Create an Excel Workbook, ALT + F11 open the VBA Editor, create a module, and copy the followingCodeNote: If the prompt variable is undefined, delete the option explicit line. The test has passed.
'Remove VBA encoding Protection
Sub moveprotect ()
Dim filename as string
Filename = application. getopenfilename ("Excel file (*. xls & *. xla), *. xls; *. xla", "VBA cracking ")
If filename = CSTR (false) then
Exit sub
Else
Vbapassword filename, false
End if
End sub
'Sets VBA encoding Protection
Sub setprotect ()
Dim filename as string
Filename = application. getopenfilename ("Excel file (*. xls & *. xla), *. xls; *. xla", "VBA cracking ")
If filename = CSTR (false) then
Exit sub
Else
Vbapassword filename, true
End if
End sub
Private function vbapassword (filename as string, optional protect as Boolean = false)
If Dir (filename) = "" then
Exit Function
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
Next
If cmgs = 0 then
Msgbox "please first set a protection password for VBA encoding...", 32, "prompt"
Exit Function
End if
If protect = false then
Dim st as string * 2
Dim S20 as string * 1
'Get a 0d0a hexadecimal string
Get #1, cmgs-2, St
'Get a hex string
Get #1, dpbo + 16, S20
'Replace the encrypted part of the server code
For I = cmgs to dpbo Step 2
Put #1, I, St
Next
'Add an unpaired symbol
If (dpbo-cmgs) mod 2 <> 0 then
Put #1, dpbo + 1, S20
End if
Msgbox "the file is successfully decrypted...", 32, "prompt"
Else
Dim mms as string * 5
MMS = "DPB = """
Put #1, cmgs, MMS
Msgbox "special file encryption is successful...", 32, "prompt"
End if
Close #1
End Function
Original address: http://www.excelba.com/showart.asp? Art_id = 81
This code is very strong ...!!
You can copy the code to VBA by yourself. I will not provide any information on cracking the file. If you have any questions, please leave a message below. Thank you.