Microsoft KB Archive/281954

= How to turn off Visual Basic for Applications when deploying Office 2003 or Office XP =

Article ID: 281954

Article Last Modified on 2/1/2007

-

APPLIES TO


 * Microsoft Office Standard Edition 2003
 * 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 &quot;Applies To&quot; 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.  Start the Custom Installation Wizard, and then click Next. 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 . 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. 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. 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?

 Click Yes, and then click Finish. After the transform file is created, click Exit to quit the Custom Installation Wizard.</ol>

For more information about customizing Office installations and about how to use the Custom Installation Wizard, visit the following Microsoft Web sites:

Office 2003

http://office.microsoft.com/en-us/assistance/HA011401941033.aspx

Office XP

http://office.microsoft.com/en-us/assistance/HA011362781033.aspx

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. <ol> Start the Custom Maintenance Wizard, and then click Next.</li> 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 .</li> 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.</li> 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?

</li> 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.</li></ol>

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

Office XP

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:
 * 4) * For Office 2003, locate and then click to select HKEY_LOCAL_MACHINE\Software\Microsoft\Office\11.0\Common.
 * 5) * For Office XP, locate and then click to select HKEY_LOCAL_MACHINE\Software\Microsoft\Office\10.0\Common.
 * 6) After you select the key that is specified in step 3, point to New on the Edit menu, and then click DWORD Value.
 * 7) Type VBAOff, and then press ENTER.
 * 8) Right-click VBAOff, and then click Modify.
 * 9) In the Value data box, type 1, and then click OK.
 * 10) 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

Additional query words: OfficeKBHowTo inf WD2002 OfficeXP Office2003

Keywords: kbhowto KB281954

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.