XL: Cannot Set Focus for Combination List-edit BoxLast reviewed: February 2, 1998Article ID: Q124808 |
The information in this article applies to:
SYMPTOMSIn the versions of Microsoft Excel listed above, the focus on a dialog box cannot be set to the list component of a combination list-edit box by changing the tab order.
WORKAROUNDIf you are using Microsoft Excel for Windows, use the SendKeys command as in the following Visual Basic example. Note that you cannot send keystrokes to applications running under the Macintosh operating system. Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/supportnet/refguide/
Sub ListFocusExample() SendKeys "{tab}" Dialogsheets(1).Show End SubWhen the subroutine is executed, the SendKeys command will tab to the list component of the combination list-edit box, giving it the focus immediately after the dialog box is displayed.
MORE INFORMATIONIn the versions of Microsoft Excel mentioned above, the focus on a dialog box is determined by the tab order of the elements in the dialog box. The first item in the tab order is designated to have the focus when the dialog box is displayed. When a combination list-edit box is created, it consists of two components: an edit box, which holds the currently selected value and allows user input, and a list box containing a set of possible values from which to choose. If the first item in the tab order is set to the list component of a combination list-edit box, the focus will be set to the next available item in the tab order.
REFERENCESFor more information about using SendKeys, choose the Search button in Visual Basic Help and type:
sendkeys |
Additional query words: 5.00 5.00a 5.00c 7.00 7.00a vb vba XL5 XL7
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |