Cannot run the macro... the macro may not be available in this workbook

cannot run the macro excel 2007 the macro may not be available
how do you fix the macro may not be available in this workbook or all macros may be disabled
cannot run the macro excel the macro may not be available
the macro may not be available in this workbook excel 2007
cannot run the macro the macro may not be available or disabled
the macro may not be available in this workbook or disabled
cannot run the macro solver
cannot run the macro wps

I am trying to call a sub on a different worksheet but I got a run time error message.

Specifically, I have two worksheets and multiple VBA sub s in those worksheets. In one of the VBA Project (say workbook1.xlsm), I have the following code:

Sub AnalysisTableMacro()
Workbooks("Python solution macro.xlsm").Activate
Application.Run "Python solution macro.xlsm!.PreparetheTables"
End Sub

But I got the following error. The macros on both worksheets are enabled. In both worksheets, the subs are in Module1.

Cannot run the macro 'Workbook.xlsm!PrepareTheTables'. The macro may not be available in >this workbook or all macros may be disabled.

I also tried Application.Run "Python solution macro.xlsm!Module1.PreparetheTables" but did not work.

If you have a space in the name of the workbook you must use single quotes (') around the file name. I have also removed the full stop.

Application.Run "'Python solution macro.xlsm'!PreparetheTables"

MS Excel Error - Cannot run the macro, The macros may not be available in this workbook or all macros may be disabled. I have a workbook that I am getting this error in everytime I try  Cannot run the macro 'Workbook.xlsm!PrepareTheTables'. The macro may not be available in >this workbook or all macros may be disabled. I also tried Application.Run "Python solution macro.xlsm!Module1.PreparetheTables" but did not work.

Per Microsoft's KB, try allowing programmatic access to the Visual Basic project:

  1. Click the Microsoft Office Button, and then click Excel Options.
  2. Click Trust Center.
  3. Click Trust Center Settings.
  4. Click Macro Settings.
  5. Click to select the Trust access to the VBA project object model check box.
  6. Click OK to close the Excel Options dialog box.
  7. You may need to close and re-open excel.

Enable or disable macros in Office files, How do you fix the macro may not be available in this workbook or all macros may be disabled? You cannot save a workbook that contains macros unless you change it from an .xlsx (the default) to one of .xlsm, .xlsb or .xls. Even if you do do that Macros can still be disabled or you can try to run a Macro that is not available in the open workbook.

Had the same issue and I 'Compiled VBA Project' which identified an error. After correction and compiling, the macros worked.

How do I get rid of this particular Excel Macro notification when , Read the error message, it couldn;t be much clearer if it tried: Quote: Cannot run the macro The macro may not be available in the workbook  The macro may not be available in this workbook or all macros may be disabled". although I Did the following : Click the Microsoft Office Button, and then click Excel Options. Click Trust Center. Click Trust Center Settings. Click Macro Settings. Click to select the Trust access to the VBA project object model check box.

You also run into this issue when you are creating routine in a class module.

When you try to run the code externally, you get this error. You can't assign macro to button to a member of a class module either.

If you try to run from within the code by pressing green play button you will also see the same error.

Either move the routine in to a regular module or create a new routine in a regular module that calls the class member.

Cannot run the macro the macro may not be available in the , This is FiX Video About Cannot run the macro 'Workbook.xlsm!.The macro may not be Duration: 7:12 Posted: Jun 22, 2019 Cannot run the macro 'Workbook.xlsm!PrepareTheTables'. The macro may not be available in >this workbook or all macros may be disabled. I also tried Application.Run "Python solution macro.xlsm!Module1.PreparetheTables" but did not work.

In my case this error came up when the Sub name was identical to the Module name.

How To Fix Cannot run the macro 'Workbook.xlsm!.The macro may , It looks like the button became unassigned from the macro. Try reassigning the button to the macro. When you first right click on the button and choose Assign  "Cannot run the macro "<my macro name>". The macro may not be available in this workbook or all macros may be disabled. In read-only I try to reassign the macro (using the right click menu of the shape). I find the macro I want to (re)assign, highlight and select OK. I then double-click the shape to run the macro.

Error: The Macro May Not Be Available In This Workbook Or All , Find answers to Cannot run the macro The macro may not be available in the workbook or all marcros may be disabled. from the expert  I have a workbook where I run a macro from a shape. This is done by manually assigning the macro in the "assign macro" dialogue box. The macro needs parameters, so the call is: NameOfWorkbook.xlsm!'NameOfMacro "parameter"' When I open the workbook and tries to run the macro from the shape, I

"Cannot run the macro The macro may not be available in the , “Cannot run the macro 'Macro3'. The macro may not be available in this workbook or all macros may be disabled” i tried everything already, 

Cannot run the macro 'Macro3'. The macro may not be available in , The macro may not be available in this workbook or all macros may be disabled" although I Did the following : Click the Microsoft Office Button, 

Comments
  • I know this is an old answer, but since this Q&A is being linked to, there needs to be a comment here that says DON'T DO THIS. This is terrible, unjustified advice that is outright dangerous. Don't tick that checkbox unless you're doing actual meta-programming in VBA, or need to run code that does. This answer is wholly inappropriate for this OP here. The ONLY reason to check this box is if you're using the VBIDE API and you know what you're doing. Otherwise, this is a massive macro-virus security hole.
  • Just to tempter Mathieu Guindon's comment here with a little realism - it's not uncommon to do this in industry, as it is a constructive step that leads to actually being able to call a macro. The security hole that it leaves is not prohibitive, in my opinion. Not that you should just do this gung ho, but this option isn't worth rejecting outright.
  • I'm not excited about this solution (naturally), but when the other recommendations failed this one succeeded