- ©«¤l
- 173
- ¥DÃD
- 42
- ºëµØ
- 0
- ¿n¤À
- 220
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 365
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-10-13
- ³Ì«áµn¿ý
- 2023-10-11
|
¦^´_ 7# Hsieh
·PÁ Hsieh ª©¥D
³o¤è«K ¤S¤£¥Î¶}±Ò ¥¨¶° ÁÂÁ ²³æ¦n¥Î
¤] ·PÁ GBKEE Åý§Ú»{ÃѤ@¨Ç VBA
¥H¤U ¬O§Ú ¦b ¨ä¥Lºô¶§ä¨ì VBA ¦ý¤£¯à¥Î
§Ú·Q§ä µLªk ²³æ´N¯}¸Ñ «OÅ@ ¤u§@ªí
µ{¦¡¦p¤U ¥i¥H×¥¿ ¨Ï¥Î¶Ü
'excel vba¤uµ{±K?¥[±K©M¯}¸Ñ
'0>ª`·N«O?ª©?¡A?¨Ñ??¨Ï¥Î¡C
'1>¤@¬qÌå¦nªºVBA«O?±K?¯}¸Ñµ{§Ç??WIN98+OFFICE97¯}¸Ñ²v100%
'2>¥Î¥H¤U¥N??VBA¥[±K«O?¦Z¥Îoffkey 6.5-7.0¤ÎAdvanced VBA pASSWORD Recovery??ª©§¡?ªk¯}¸Ñ¥X«O?µ{¦¡?ªº±K?
'²¾°£VBA??«O?
Sub MoveProtect()
Dim FileName As String
FileName = Application.GetOpenFilename("Excel¤å¥ó¡]*.xls & *.xla¡^,*.xls;*.xla", , "VBA¯}¸Ñ")
If FileName = CStr(False) Then
Exit Sub
Else
VBAPassword FileName, False
End If
End Sub
'?¸mVBA??«O?
Sub SetProtect()
Dim FileName As String
FileName = Application.GetOpenFilename("Excel¤å¥ó¡]*.xls & *.xla¡^,*.xls;*.xla", , "VBA¯}¸Ñ")
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 For
Next
If CMGs = 0 Then
MsgBox "?¥ý?VBA???¸m¤@?«O?±K?...", 32, "´£¥Ü"
Exit Function
End If
If Protect = False Then
Dim St As String * 2
Dim s20 As String * 1
'¨ú±o¤@?0D0A¤Q¤»?¨î¦r¦ê
Get #1, CMGs - 2, St
'¨ú±o¤@?20¤Q¤»¨î¦r¦ê
Get #1, DPBo + 16, s20
'´À?¥[±K³¡¥÷Éó?
For i = CMGs To DPBo Step 2
Put #1, i, St
Next
'¥[¤J¤£°t?²Å?
If (DPBo - CMGs) Mod 2 <> 0 Then
Put #1, DPBo + 1, s20
End If
MsgBox "¤å¥ó¸Ñ±K¦¨¥\......", 32, "´£¥Ü"
Else
Dim MMs As String * 5
MMs = "DPB="""
Put #1, CMGs, MMs
MsgBox "?¤å¥ó¯S®í¥[±K¦¨¥\......", 32, "´£¥Ü"
End If
Close #1
End Function |
|