从Excel中删除功能区 [英] Remove Ribbon from Excel

查看:211
本文介绍了从Excel中删除功能区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图删除Excel窗口的功能导航栏。目前我使用下面的code这消除色带。

I'm trying to remove the ribbon bar from the Excel window. Currently I'm using the following code which removes the ribbon.

excelApp.ExecuteExcel4Macro("SHOW.TOOLBAR(""Ribbon"",False)") 

但是,这也消除一切之上的细胞,包括标题栏。我需要的标题栏,使用户可以移动,最小化,最大化和关闭窗口。理想情况下,我想删除整个色带,但我会满意,如果我能尽量减少对功能区中的图标。我可以最小化功能区的图标点击黑色小长方形和三角形图标的标题栏所以它必须是可能的。

But it also removes everything above the cells including the title bar. I need the title bar so users can move, minimize, maximize and close the window. Ideally I would like to remove the entire ribbon but I would be satisfied if I could minimize the Icons on the Ribbon. I can minimize the ribbon icons by clicking the small black rectangle and triangle icon on the title bar so it must be possible.

推荐答案

从来没有发现一个很好的解决办法,除了在VBA这个聪明的解决方案,你应该能够在.NET中重现。

Never found a good workaround, except this clever solution in VBA that you should be able to recreate in .net.

Sub HideRibbon()

Application.SendKeys ("^{F1}")

End Sub

按Ctrl + F1的组合,以尽量减少色带和最大化,所以你可以使用它作为一个切换按钮,如果你真的希望。您可以设置此为在工作簿中运行开放,如果你喜欢用简单的VBA。

Ctrl+F1 is the combination to minimize the ribbon and maximize it, so you can use this as a toggle button if you really wish. You could set this up to run at workbook open if you like using simple VBA.

这篇关于从Excel中删除功能区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆