We help IT Professionals succeed at work.
Troubleshooting Question

While assigning macro, why is workbook name sometimes included?

Last Modified: 2020-10-26
When clicking on a shape, and assigning a macro, I am trying to understand why the workbook name is shown in some instances, and not in other:

See how the 2 near the bottom includes the workbook name, but the rest of them don't?

I am looking to understand why it happens, and how to remove it. It should always call the macro in the active workbook.

P.s. the workbook shown IS the active workbook in this case.
Watch Question

Subodh Tiwari (Neeraj)Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015

The macros, which are not present in the Workbook in which you inserted the shape and trying to assign a macro to it, are preceded with the file name.
And if you choose ThisWorkbook from the Macros in: drop-dwon, you will find the macro names without the file name.
The default selection in this drop-down is All Open Workbooks and that shows all the available macros from all the opened workbooks.

Anders Ebro (Microsoft MVP)Microsoft Developer


I only have 1 open workbook. Changing the dropdown to "This Workbook", still leaves the name in front of the workbook.

I then tried assigning the macro with the name in front of it, and running it in the onclick. I was now told that macros in this workbook are disabled, even though I could run a macro in another sheet in the workbook.

Anyway, closing and re-opening the file made the issue go away. I blame Excel.

Thank you for your assistance.

Microsoft Developer
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
Subodh Tiwari (Neeraj)Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015

Sorry Anders, I stuck in something else so couldn't read your reply.
You are correct, this weird issue gets resolved after closing and re-opening the workbook.
I have also encountered the same issue several times.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions