Mac – Excel VBA Macro Sub or Function not defined

macrosmicrosoft excelmicrosoft-excel-2007vba

I used the macro recorder to generate a macro in Excel 2007. When I try to the run the macro, it tells me:

Compile error:  Sub or Function not defined

When I click Ok the definition of the macro gets highlighted.

enter image description here

I'm really confused about why VBA would throw this error. I just defined it! Do you have any ideas what I did wrong?

Best Answer

  • 1st - check if there's no missing reference in the VBA project.
  • 2nd - It seems it needs the Solver Addin. Ensure it's checked in Excel Addins.
Related Question