What VBA instruction can be used to make the "Queries and Connections" appear on the screen and show the "Connections" tab?

Serge_58 0 Reputation points
2023-03-20T12:45:22.7266667+00:00

Following VBA instruction will make the "Queries and Connections" menu appear on the screen, and by default it opens on the 'Queries' tab (or in case the user had manually opened it before, to the last tab that was selected by the user - which can be either one of both)

Application.CommandBars("Queries and Connections").Visible = True

What instruction can be used to make the menu switch to the 'Connections' tab?

Following command 'Application.CommandBars("Queries and Connections").Controls("Connections").Execute' generates run-time error 5 'invalid procedure call or argument'...

Thanks for your help.

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.