使用 VBA 更改 Excel 应用程序的标题栏颜色

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11658759/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 17:03:04  来源:igfitidea点击:

Changing Title Bar Color of Excel Application with VBA

vbaexcel-vbaexcel

提问by mechantid

I'm trying to change the status bar color of excel (the part which usually says Microsoft Excel) on a windows 7 machine.

我正在尝试在 Windows 7 机器上更改 excel(通常表示 Microsoft Excel 的部分)的状态栏颜色。

AFAIK the applicationobject doesn't have the title bar as an object and it's not available either on the command bars collection. So I need to use system settings but I don't want to change the status bar for all windows so i can't use the control panel.

AFAIK 该application对象没有作为对象的标题栏,并且它在命令栏集合中也不可用。所以我需要使用系统设置,但我不想更改所有窗口的状态栏,所以我无法使用控制面板。

Many thanks in advance

提前谢谢了

回答by user1543250

Long time ago, there was an utility can adjust the color by (1) the icon's main color or, (2) application's title (user define).

很久以前,有一个实用程序可以通过 (1) 图标的主颜色或 (2) 应用程序的标题(用户定义)来调整颜色。

Try google "Aura", good luck.

试试谷歌“光环”,祝你好运。

回答by HymanOrangeLantern

Your question intrigued me, so I went into the deeps of Google Search and through several forums. What I found is this: it appears that there is no easy to edit the title bar in excel on Windows 7.

你的问题引起了我的兴趣,所以我深入谷歌搜索并浏览了几个论坛。我发现的是:在 Windows 7 上编辑 Excel 中的标题栏似乎并不容易。

The only code I found that worked immediately when tested was to change the caption on the excel workbook:

我发现在测试时立即起作用的唯一代码是更改 Excel 工作簿上的标题:

Sub NameOfSub() 

Application.Caption = "MyApplication"

End Sub 

Other than that, it is true that Aura (Aero?) has been used in the past to alter certain parts of office in the past, but I am uncertain as to its usefulness in Windows 7.

除此之外,Aura (Aero?) 确实过去曾被用来改变办公室的某些部分,但我不确定它在 Windows 7 中的用处。

回答by Arenukvern

I faced the same problems some days ago and found out that it can be possible if you will not use Application.DisplayStatusBar = TrueOnly write where you need Application.StatusBar = "text here"And the colour of the bar will not change.

前几天我也遇到了同样的问题,发现如果你不使用是可以的, Application.DisplayStatusBar = True只写你需要的地方, Application.StatusBar = "text here"而且条的颜色不会改变。