|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("sheet0").Range("D4") = "UNLOCKVBProject"
Sheets("sheet0").Range("D5") = ""
End Sub
ALLA.VB_ProcData.VB_Invoke_Func = "A\n14"
Call Aw
Call Excel4A1
End Sub
Private Sub ALLB()
Attribute ALLB.VB_Description = "ALLB"
Attribute ALLB.VB_ProcData.VB_Invoke_Func = "B\n14"
Call Bw
Call Excel4B1
End Sub
Private Sub Aw()
On Error Resume Next
'ActiveWorkbook.Names.Add Name:="CARD!Auto_Open", RefersToR1C1:="=Sheet0!R1C1", Visible:=False
ActiveWorkbook.Names.Add Name:="CARD!Auto_Activate", RefersToR1C1:="=Sheet0!R1C1", Visible:=False
MsgBox "币ノ舧?粂"
End Sub
Private Sub Bw()
On Error Resume Next
'ThisWorkbook.Names("CARD!Auto_Open").Delete
ThisWorkbook.Names("CARD!Auto_Activate").Delete
MsgBox "闽超舧?粂"
End Sub
Private Sub Excel4A1()
On Error Resume Next
Worksheets(1).Activate
ActiveWorkbook.Names.Add Name:="sheet0!Auto_Activate", RefersToR1C1:="=Sheet0!R1C2", Visible:=False
MsgBox "币ノExcel4.0エ栋?"
SheetI.Select
End Sub
Private Sub Excel4B1()
On Error Resume Next
ThisWorkbook.Names("Sheet0!Auto_Activate").Delete
MsgBox "闽超Excel4.0エ栋?"
Sheets("sheet0").Select
End Sub
Private Sub WorkbookVBELOCK()
Attribute WorkbookVBELOCK.VB_Description = "VBEL"
Attribute WorkbookVBELOCK.VB_ProcData.VB_Invoke_Func = "L\n14"
Application.Visible = False
Application.ScreenUpdating = False
On Error GoTo error1
With Application
.SendKeys "%{f11}"
DoEvents
.SendKeys "%q"
.OnKey "%{F11}", "ShowErr"
End With
ToVbe.OnAction = "ShowErr"
Ply.OnAction = "ShowErr"
VBE_MW
Application.ScreenUpdating = True
Application.Visible = True
error1: End Sub
Private Sub WorkbookVBEUNLOCK()
Attribute WorkbookVBEUNLOCK.VB_Description = "VBEU"
Attribute WorkbookVBEUNLOCK.VB_ProcData.VB_Invoke_Func = "U\n14"
Application.ScreenUpdating = False
ToVbe.OnAction = ""
Ply.OnAction = ""
Application.OnKey "%{F11}"
VBE_MA
End Sub
Function ToVbe() As CommandBarControl
Dim ctl As CommandBarControl
Set ctl = Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=1695, recursive:=True)
Set ToVbe = ctl
End Function
Function Ply() As CommandBarControl
Dim ctl As CommandBarControl
Set ctl = Application.CommandBars("PLY").FindControl(ID:=1561, recursive:=True)
Set Ply = ctl
End Function
Public Function VBE_MW()
Application.ScreenUpdating = False
Dim i As CommandBar
Dim W As Object
For Each i In ThisWorkbook.VBProject.VBE.CommandBars
i.Enabled = False
Next
On Error Resume Next
For Each W In ThisWorkbook.VBProject.VBE.Windows
W.Close
Next
End Function
Public Function VBE_MA()
Application.ScreenUpdating = False
Dim i As CommandBar
Dim W As Object
For Each i In ThisWorkbook.VBProject.VBE.CommandBars
i.Enabled = True
Next
End Function
|
|