首页 > 解决方案 > Excel VBA - 无法更改停靠的“查询和连接”的宽度

问题描述

我正在尝试以编程方式打开“查询和连接”命令栏。它默认停靠在右侧 (msoBarRight)

但是,仅设置.Visible = True会打开它太窄。
我试图通过设置.Width来解决这个问题,但它只是忽略了它......
如果 CommandBar 浮动没有问题。

我正在使用 Excel 365。
示例代码如下:

With Application.CommandBars("Queries and Connections")
    .Visible = True
    .Width = 350 'This part does nothing
End With

标签: excelvbacommandbar

解决方案


推荐阅读