Run-time Error Using SendKeys to Send Right Brace CharacterLast reviewed: July 29, 1997Article ID: Q114343 |
The information in this article applies to:
SYMPTOMSIf 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 callNote that this problem does not occur if you use the SendKeys command to send the left brace character "{".
WORKAROUNDSTo 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.
STATUSMicrosoft 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 INFORMATIONThe 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 REFERENCESFor more information about the SendKeys Statement or the SendKeys Method, choose the Search button in the Visual Basic Reference and type:
SendKeys Keywords : kbcode kbprg Version : 1.00 4.00 5.00 Platform : WINDOWS Issue type : kbbug Solution Type : Info_Provided |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |