Excel 2007 - "The macro may not be available in this workbook" Error
Posted
by Psycho Bob
on Stack Overflow
See other posts from Stack Overflow
or by Psycho Bob
Published on 2010-04-20T14:01:28Z
Indexed on
2010/04/20
14:03 UTC
Read the original article
Hit count: 1877
macro
|excel-2007
We use an Excel sheet that has been protected to prevent modification of it from end users. All in all they are only able to edit certain tabs to add information that will then be used to generate information on other tabs using equations and such. On the tab with the equations, a button is present called "Prep for Internal Hard Copy Print." This button runs a macro that selects the information on the tab, unprotects it, then sends a print job to the user's default printer that contains the unprotected content. Normally this works like a champ.
This time around, however, the macro is throwing the following error:
Cannot run the macro "FILENAME.xlsx'!MacroName'. The macro may not be available in this workbook or all macros may be disabled.
As far as I can tell, the macros are still present within the workbook. This sheet is normally a .xlsm though the user saved it with a different filename as a .xlsx. Also, the macros appear only as MacroName in the .xlsm file and not "FILENAME.xlsx'!MacroName' as it does in the .xlsx. Finally, when I open the .xlsm it asks if I want to enable the macro content while the .xlsx does not prompt for this.
Can anyone tell me what's going on with this sheet or know of a way that I can get the macros working in the .xlsx without having to start over with a different sheet?
© Stack Overflow or respective owner