Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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.

↑ Back to the top


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

↑ Back to the top


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.

↑ Back to the top


Keywords: kbtshoot, kberrmsg, kbexpertisebeginner, kbprb, kb

↑ Back to the top

Article Info
Article ID : 948682
Revision : 1
Created on : 1/7/2017
Published on : 2/22/2008
Exists online : False
Views : 165