Excel VBA - 无法更改停靠"Queries & Connections"的宽度



我正在尝试以编程方式打开"查询&"连接";CommandBar。默认情况下,它停靠在右侧(msoBarRight(

但是,只需设置。Visible=True打开范围过窄
我试图通过设置来解决这个问题。宽度,但它只是忽略它…
如果CommandBar是浮动的,则没有问题。

我使用的是Excel 365。
下面的示例代码:

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

右侧强制对接。宽度工作对我来说。任何其他的。位置也可以,但如果你想让窗格停靠在右边,这是可行的:

With Application.CommandBars("Queries and Connections")
.Visible = True
.Position = msoBarRight
.Width = 400
End With

最新更新