VBA生成Excel2003经典菜单
责任编辑:hylng    浏览:6786次    时间: 2012-12-31 23:24:48      

免职声明:本网站为公益性网站,部分信息来自网络,如果涉及贵网站的知识产权,请及时反馈,我们承诺第一时间删除!

This website is a public welfare website, part of the information from the Internet, if it involves the intellectual property rights of your website, please timely feedback, we promise to delete the first time.

电话Tel: 19550540085: QQ号: 929496072 or 邮箱Email: Lng@vip.qq.com

摘要:虽然Excel的最新版本已经是2010版,但还是不少人还一直在用Excel2003以下版,或者还习惯于老版本的经典菜单。从2007版界面的变动,让很多习惯于旧版界面的用户不太适应,因此收集了下面两个在新版中,生成经典菜单的VBA代码: 添加2003版菜单到右键菜单中() With App..

分享到:

虽然Excel的最新版本已经是2010版,但还是不少人还一直在用Excel2003以下版,或者还习惯于老版本的经典菜单。从2007版界面的变动,让很多习惯于旧版界面的用户不太适应,因此收集了下面两个在新版中,生成经典菜单的VBA代码:

 添加2003版菜单到右键菜单中()
With Application.CommandBars("cell")
.Reset
With .Controls.Add(Type:=msoControlButton, before:=1)
.Caption = "2003版菜单"
.BeginGroup = True
.OnAction = "菜单2003"
End With
End With
End Sub
Sub 菜单2003()
Application.CommandBars("Built-in Menus").ShowPopup
End Sub
Sub 重置右键菜单()
Application.CommandBars("cell").Reset
End Sub

Sub 生成2003版菜单在加载项中()
Set tbar = CommandBars.Add("Excelba")
tbar.Visible = True
For Each a In Array(1, 4, 8, 10, 13, 18, 23, 27, 28)
CommandBars("Built-in Menus").Controls(a).Copy (tbar)
Next
End Sub
Sub 删除加载项中2003版菜单()
CommandBars("Excelba").Delete
End Sub

】【打印繁体】【投稿】 【收藏】 【推荐】 【举报】 【评论】 【关闭】【返回顶部