从Excel中删除功能区功能、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 ribbo...

我试图删除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.

阅读全文

相关推荐

最新文章