A macro does not work in a new Excel workbook after you copy a worksheet to the workbook in Office Excel 2007


Symptoms


You assign a macro to an object in an Excel worksheet. After you copy the worksheet to a new Excel workbook in Microsoft Office Excel 2007, the macro does not work in the new workbook and you receive the following error message: 
Cannot run the macro <macro name >. The macro may not be available in this workbook or all macros may be disabled.

Resolution


Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows
To resolve this problem, apply the hotfix package that is described in Microsoft Knowledge Base (KB) article 981731. Then, set the Enforce2003CopyOBName registry entry to enable the hotfix. To do this, follow these steps:
  1. Apply hotfix package 981731.
    For more information, click the following article number to view the article in the Microsoft Knowledge Base:

    981731 Description of the Office Excel 2007 hotfix package (excel-x-none.msp, graph-x-none.msp, oartconv-x-none.msp, oart-x-none.msp, xlconv-x-none.msp): April 27, 2010

  2. Set the Enforce2003CopyOBName registry entry. To do this, follow these steps:
    1. Start Registry Editor.
      • In Windows Vista, click Startthe Start button , type regedit in the Start Search box, and then press ENTER.

        User Account Control If you are prompted for an administrator password or for confirmation, type the password, or provide confirmation.
      • In Windows XP, click Start, click Run, type regedit in the Open box, and then click OK.
    2. Locate and then click the following registry subkey:
      HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Options
    3. On the Edit menu, point to New, and then click DWORD Value.
    4. Type Enforce2003CopyOBName, and then press ENTER.
    5. Right-click Enforce2003CopyOBName, and then click Modify.
    6. In the Value data box, type 1, and then click OK.
    7. Exit Registry Editor.

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.