打开一个excel文件,按ALT F11,然后在打开的窗口中单击插入——模块,将下列字体复制到对话框中:
Sub aaa()
Dim aa, bb As Boolean
aa = True
bb = False
Application.CommandBars(“ply”).Enabled = aa
Application.CommandBars(“cell”).Enabled = aa
Application.CommandBars(“toolbar list”).Enabled = aa
Application.CommandBars(“autocalculate”).Enabled = aa
Application.CommandBars(“worksheet menu bar”).Enabled = aa
Application.CommandBars(1).Enabled = aa
Application.CommandBars(2).Enabled = aa
Application.CommandBars(3).Enabled = aa
Application.CommandBars(3).Controls(3).Enabled = aa
Application.CommandBars(4).Enabled = aa
Application.CommandBars(5).Enabled = aa
Application.CommandBars(1).Enabled = aa
Application.CommandBars(1).Controls(1).Enabled = aa
Application.CommandBars(“file”).Controls(“页面设置(&U)…”).Enabled = aa
Application.CommandBars(1).Controls(4).Enabled = aa
Application.CommandBars(1).Controls(4).Caption = “victor”
Application.CommandBars(1).Reset
Application.DisplayFormulaBar = aa
Application.DisplayStatusBar = aa
ActiveWindow.DisplayHeadings = aa
ActiveWindow.DisplayWorkbookTabs = aa
ActiveWindow.DisplayHorizontalScrollBar = aa
ActiveWindow.DisplayVerticalScrollBar = aa
End Sub
然后按F5,运行宏aaa,然后关闭,回到excel中就可以看到工具栏、菜单栏等都又出现了。