Microsoft KB Archive/114343

{|
 * width="100%"|

Run-time Error Using SendKeys to Send Right Brace Character

 * }

Q114343

-

The information in this article applies to:


 * Microsoft Visual Basic for Applications version 1.0
 * Microsoft Excel for Windows, versions 5.0, 5.0c
 * Microsoft Project for Windows, version 4.0

-

SYMPTOMS
If you use the SendKeys command to send the right brace character "}"in a Visual Basic, Applications Edition procedure, you receive the following error message:

Run-time error '5':

Invalid procedure call

Note that this problem does not occur if you use the SendKeys command to send the left brace character "{".

WORKAROUNDS
To work around this problem in Microsoft Excel, you can use the SendKeys method as in the following example:

  Application.SendKeys "{}}" "-or-"   Application.SendKeys "{" & chr$(125) & "}" Note that you cannot use the SendKeys method (Application.SendKeys) in Microsoft Project.

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION
The error message described above appears if you use either of the following methods in a Visual Basic, Applicaitons Edition procedure to send this character:

  SendKeys "{}}" "-or-"   SendKeys "{" & chr$(125) & "}" NOTE: The following equivalent code works in Visual Basic for Windows Programming System, version 3.0.

  Sub Form_Click SendKeys "{}}" End Sub