Current location - Quotes Website - Signature design - How to delete excel macros
How to delete excel macros
Tools-Macros, select the name of the macro you want to delete, and then select Delete.

Its delete button is gray, and the editor may have set password protection.

Create a new worksheet, press ALT+F 1 1 to enter the VBA editor, create a new module, copy the following code into it, run the MoveProtect macro to delete the password, and then delete the macro.

Remove VBA encoding protection.

Child MoveProtect ()

Mark the file name as a string

Filename = application.getopenfilename ("Excel file (*. xls & amp; *.xla),*。 Xls*.xla ","VBA cracking ")

If FileName = CStr(False), then

outlet connection

other

VBAPassword file name, False

If ... it will be over.

End joint

Set VBA coding protection

Subset protection ()

Mark the file name as a string

Filename = application.getopenfilename ("Excel file (*. xls & amp; *.xla),*。 Xls*.xla ","VBA cracking ")

If FileName = CStr(False), then

outlet connection

other

VBAPassword file name, True.

If ... it will be over.

End joint

Private function VBAPassword (file name is string, optional protection is Boolean = False)

If directory (file name) = ",then

Exit function

other

File copy file name, file name and. ".bak "

If ... it will be over.

Dim GetData As String * 5

Open the file name of the binary file as # 1

Darken the image to be 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.

then

If CMGs = 0, then

MsgBox "Please set the protection password for VBA coding first ...", 32, "Prompt"

Exit function

If ... it will be over.

If Protect = False, then

Dim St As String * 2

Display s20 as a string * 1

Gets the 0D0A hexadecimal string.

Get # 1, CMGs-2, St

Gets a hexadecimal string of 20.

Get # 1, DPBo+16, s20.

Replace the encrypted part of the key.

For i = CMGs to DPBo step 2

Put # 1, I, St.

then

Add unpaired symbols

if(DPBo-CMGs)Mod 2 & lt; & gt then 0

Put # 1, DPBo+1, s20

If ... it will be over.

MsgBox "File decrypted successfully ...", 32, "Prompt"

other

Display MMS as a string * 5

MMs = "DPB= " "

Play # 1, SMS, MMS.

MsgBox "Special encryption of file succeeded ...", 32, "Prompt"

If ... it will be over.

Close # 1

End function