Command Bar ShowPopup No Longer Works in Excel 2013

kleavitt95

New Member
Joined
Aug 26, 2019
Messages
1
I built a macro in Excel 2010 that does a Vlookup from one spreadsheet to another, and when the macro is run, a popup box appears and lets the user click which tab they want the macro to perform the Vlookup on. I used the following code and it was simple and very effective.

Dim cbTool as CommandBar
Set cbTool = CommandBar("Workbook Tabs")
cbTool.ShowPopup

This worked perfectly until my boss upgraded to Excel 2013 and running this macro now returns the error "Method 'ShowPopup' of object 'CommandBar' failed." Clearly something in Excel 2013 has changed since it's still working in Excel 2010.

I've looked everywhere trying to find replacement code to achieve this in Excel 2013 but haven't had any luck. Any ideas what code I could use to pop up a list of all workbook tabs in the middle of a macro so the user can select a tab? Thank you!!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
I don't think that code would work in any version. Try this:
Code:
Set cbTool = [B]Application.CommandBars[/B]("Workbook Tabs")
 
Upvote 0
You just need an s.
Code:
Sub Main()
    Dim cbTool As CommandBar
    Set cbTool = CommandBars("Workbook Tabs")
    cbTool.ShowPopup
End Sub
or just
Code:
CommandBars("Workbook Tabs").ShowPopup
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,582
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top