Error message when you run a VBA command in the Immediate window of the Visual Basic Editor: "Runtime Error '4120' Bad parameter"

Symptoms

Consider the following scenario. You install the OEM version of the 2007 Microsoft Office system. You start Microsoft Office Word 2007. In the Immediate window of the Microsoft Visual Basic Editor, you run one of the following Microsoft Visual Basic for Application (VBA) commands:
  • application.showwindowsinTaskbar=false
  • application.Options.ConfirmConversions = False
  • application.Options.BackgroundSave=False
  • application.Options.SmartCursoring=False
  • application.Options.AllowDragAndDrop=False
In this scenario, you may receive the following error message:
Runtime Error '4120'
Bad parameter

OK Help
Note This issue may not occur for all computers that are running the OEM version of the 2007 Office system. Also, this issue may not occur for all VBA commands.

Cause

This issue occurs because the NoUserName option is set to true when the OEM version of the 2007 Microsoft Office system is installed. Therefore, a blank UserInfo registry entry is created, and the user name and the initials are blank.

The user name and initials are stored in the following registry location:
HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo

Resolution

To resolve this issue, add the user name and the initials in the Word Options dialog box.

To do this, click the
Microsoft Office Button, click Word Options, enter a user name and initials under Personalize your copy of Microsoft Office, and then click OK.
Eigenschappen

Artikel-id: 948682 - Laatst bijgewerkt: 22 feb. 2008 - Revisie: 1

Feedback