How to turn off Visual Basic for Applications when deploying Office 2003 or Office XP (281954)



The information in this article applies to:

  • Microsoft Office 2003, All Editions
  • Microsoft Office XP (Setup)

This article was previously published under Q281954

SUMMARY

This article describes how to disable Visual Basic for Applications during the deployment of the versions of Office that are listed in the "Applies To" section.

MORE INFORMATION

Visual Basic for Applications, although not a security risk in itself, can be used by others to compromise security. For this reason, Office can be installed without Visual Basic for Applications support.

The following methods can be used to remove Visual Basic for Applications support in Office.

Note The Custom Maintenance Wizard and the Custom Installation Wizard can only be used with the Enterprise edition of Microsoft Office.

Method 1: Custom Installation Wizard

Note This method can only be used with the Enterprise edition of Microsoft Office.

The Custom Installation Wizard, included with the Microsoft Office Resource Kit (ORK), can be used to create a custom TRANSFORM file that is used with Setup.exe to customize the installation of Office features during Setup. To create a TRANSFORM that removes Visual Basic for Applications support during installation, follow these steps.

Note To do this, you must install the ORK. You can install the ORK from the ORK folder on the Office CD for an Enterprise edition of Office.
  1. Start the Custom Installation Wizard, and then click Next.
  2. In the Name and path of MSI file to open box, type the full path and file name of your .msi file, and then click Next twice.

    Note An .msi file is included with the Office installation CD. For example, type D:\PROPLUS.MSI.
  3. In the Name and path of MST file box, type the path and file name with which you want to save your custom Setup file, and then click Next three times.
  4. In the Set Feature Installation States page of the Custom Installation Wizard, in the For each of the following Microsoft Office features, click to select the default installation state list, expand Office Shared Features.
  5. Click Visual Basic for Applications, and then on the shortcut menu that appears, click Not Available, Hidden, Locked.

    You receive the following message:

    You have chosen not to install Visual Basic for Applications. Microsoft Access requires this component and will not be installed if you continue. Additional features in Microsoft Office, including some wizards and templates, will not work properly.

    Do you want to install Microsoft Office without Visual Basic for Applications?

  6. Click Yes, and then click Finish. After the transform file is created, click Exit to quit the Custom Installation Wizard.
For more information about customizing Office installations and about how to use the Custom Installation Wizard, visit the following Microsoft Web sites:

Office 2003Office XP

Method 2: Custom Maintenance Wizard

Note This method can only be used with the Enterprise edition of Microsoft Office.

The Custom Maintenance Wizard, included with the Microsoft Office Resource Kit (ORK), is used to create a Custom Maintenance Wizard customization file (CMW file) that can be used to update an existing Office installation. To create a CMW file to remove Visual Basic for Applications support, follow these steps.

Note To do this, you must install the ORK. You can install the ORK from the ORK folder on the Office CD for an Enterprise edition of Office.
  1. Start the Custom Maintenance Wizard, and then click Next.
  2. In the Name and path of MSI file to open box, type the full path and file name of your .msi file, and then click Next twice.

    Note An .msi file is included with the Office installation CD. For example, for Microsoft Office XP Professional Plus, you would type D:\PROPLUS.MSI.
  3. Click Next twice, and then on the Set Feature Installation States page, in the For each of the following Microsoft Office features, click to select the desired installation state list, expand Office Shared Features.
  4. Click Visual Basic for Applications, and then on the shortcut menu that appears, click Not Available, Hidden, Locked.

    You receive the following message:

    You have chosen not to install Visual Basic for Applications. Microsoft Access requires this component and will not be installed if you continue. Additional features in Microsoft Office, including some wizards and templates, will not work properly.

    Do you want to install Microsoft Office without Visual Basic for Applications?

  5. Click Yes, and then click Finish. After the Custom Maintenance Wizard configuration file (CMW file) is created, click Exit to quit the Custom Maintenance Wizard.
For additional information on the Custom Maintenance Wizard, click the following article number to view the article in the Microsoft Knowledge Base:

308263 How to create a Custom Maintenance Wizard file for updating installation options after you deploy a custom installation of Office

Method 3: System Policy

System Policy Editor, included with the Microsoft Office Resource Kit (ORK), can be used to turn off Visual Basic for Applications support for Office programs.

Turning on the Disable VBA for Office applications policy sets the VBAOFF DWORD value to 1 in the following registry subkey:

Office 2003

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Office\11.0\Common

Office XP

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Office\10.0\Common


This Registry setting prevents Excel, FrontPage, Outlook, PowerPoint, Publisher, and Word from using Visual Basic for Applications.

Method 4: Stand-alone Office installation

During or after an Office installation, you can specify the features that you want installed. To do this, follow these steps:
  1. In Office Setup, on the Choose installation options for all Office applications and tools page, in the Features to install list, expand Office Shared Features.
  2. Click Visual Basic for Applications. On the shortcut menu that appears, click Not Available.
  3. Continue the Office installation or update.
Microsoft Access requires Visual Basic for Applications. To enable the installation of Access, and disable Visual Basic for Applications in all other Office programs, install a stand-alone version of Microsoft Access, and then install Office as a Custom installation with Visual Basic for Applications disabled.

Method 5: Manually add the VBAOff registry subkey

The VBAOff registry subkey can be added manually to disable VBA functionality for all users on a computer after Office has been installed. To add the VBAOff registry key, follow these steps:
  1. Exit your version of all Office programs.
  2. Click Start, click Run, type regedit, and then click OK.
  3. Locate and then click to select one of the following registry keys, depending on the version of the product that you are using:
    • For Office 2003, locate and then click to select HKEY_LOCAL_MACHINE\Software\Microsoft\Office\11.0\Common.
    • For Office XP, locate and then click to select HKEY_LOCAL_MACHINE\Software\Microsoft\Office\10.0\Common.
  4. After you select the key that is specified in step 3, point to New on the Edit menu, and then click DWORD Value.
  5. Type VBAOff, and then press ENTER.
  6. Right-click VBAOff, and then click Modify.
  7. In the Value data box, type 1, and then click OK.
  8. On the File menu, click Exit to quit Registry Editor.

For additional information about features that are turned off when Visual Basic for Applications is not installed, click the following article number to view the article in the Microsoft Knowledge Base:

281953 Features turned off when Visual Basic for Applications is not installed

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

287567 Considerations for disabling VBA in Office XP

285884 How to determine whether VBA is enabled for Office XP application


Modification Type:MinorLast Reviewed:9/12/2006
Keywords:kbhowto KB281954