When you run a VBA macro that uses the Range.Copy or the Range.Paste method on a Range object in Word 2003, the macro does not complete, and you receive an error message

Article translations Article translations
Article ID: 896987
Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 Description of the Microsoft Windows registry
Expand all | Collapse all

On This Page

Symptoms

When you run a Microsoft Visual Basic for Applications (VBA) macro in a document in Microsoft Office Word 2003, if the macro uses the Range.Copy or the Range.Paste method on a Range object, the macro is not completed. Additionally, you receive the following error message:
Runtime Error 4605:

This method or property is not available because the object refers to a protected area of the document.

Cause

This problem may occur when all the following conditions are true:
  • The document contains both protected and unprotected sections.
  • The document contains one or more text form fields that do not have the Fill-in enabled option selected. Additionally, the text form field comes before any one of the following elements:
    • A check box form field.
    • A drop-down form field.
    • An ActiveX control from the Control toolbox.
  • The macro programmatically defines a Range object on text in an unprotected section in the document.
  • The macro uses the Range.Copy or the Range.Paste method.

Resolution

This problem was first fixed in a hotfix that is now contained in a service pack. If you installed the latest Office 2003 service pack, you do not have to install the hotfix.

Service pack information

This problem is corrected in Office 2003 Service Pack 2.

To resolve this problem, obtain the latest service pack for Office 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
870924 How to obtain the latest service pack for Office 2003


After you install the service pack, follow the steps that are listed in the "More Information" section to set the EnsureFlagsOfProtectedDocForVbaSel registry key and to enable the hotfix.

Hotfix information

How to obtain the hotfix

This issue is fixed in the Word 2003 post-Service Pack 1 Hotfix Package that is dated April 21, 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
897250 Description of the Word 2003 post-Service Pack 1 hotfix package: April 21, 2005
After you install this hotfix, follow the steps that are listed in the "More Information" section to set the EnsureFlagsOfProtectedDocForVbaSel registry key and to enable the hotfix.

Workaround

To work around this problem, turn on the Fill-in enabled option in the text form fields that comes before any one of the elements that are listed in the "Cause" section.

To do this, follow these steps:
  1. Start Word 2003, and then open the document or the template.
  2. On the Tools menu, click Unprotect Document.
  3. Right-click the text form field, and then click Properties.
  4. Click to select the Fill-in enabled check box.
  5. Click OK to close the Text Form Field Options dialog box.
  6. Repeat steps 3 through 5 for each text form field.
  7. On the Protect Document task pane, click Yes, Start Enforcing Protection.
  8. Save the document or the template.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Office 2003 Service Pack 2.

More information

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

To enable this hotfix, follow these steps:
  1. Quit Word 2003.
  2. Click Start, click Run, type regedit, and then click OK.
  3. Locate and then click to select the following registry subkey:
    HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Options
  4. After you select the subkey that is specified in step 3, point to New on the Edit menu, and then click DWORD Value.
  5. Type EnsureFlagsOfProtectedDocForVbaSel, and then press ENTER.
  6. Right-click EnsureFlagsOfProtectedDocForVbaSel, and then click Modify.
  7. In the Value data dialog box, type 1, and then click OK.
  8. On the File menu, click Exit to quit Registry Editor.

Properties

Article ID: 896987 - Last Review: June 20, 2014 - Revision: 5.0
Keywords: 
kbqfe kbregistry kboffice2003sp2fix kbmacro kbprogramming kbautomation kbvba kboffice2003presp2fix kbbug kbfix KB896987

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com