XL: Cannot Set Focus for Combination List-edit BoxID: Q124808
|
In 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.
If you are using Microsoft Excel for Windows, use the SendKeys command
as in the following Visual Basic example.
NOTE: 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 professionals 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 Sub
In 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.
For more information about using SendKeys, choose the Search button in
Visual Basic Help and type:
sendkeys
Additional query words: 5.00a 5.00c 7.00a vb vba XL5 XL7
Keywords : kbcode kbprg
Version : WINDOWS:5.0,5.0c,7.0,7.0a; MACINTOSH:5.0,5.0a
Platform : MACINTOSH WINDOWS
Issue type :
Last Reviewed: July 23, 1999