LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to set focus on an ActiveX ListBox

I am stymied trying to figure the code that sets the focus of an
ActiveX ListBox to the first name appearing in the ListBox. The
ListBox is on Sheet1.

I tried this code but get the error message "Compile Error Sub or
Function not defined"

I am using Excel 2007

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("Sheet1").Select
OLEObject("ListBox1").Value = "ABC"
Application.ScreenUpdating = True
End Sub

Can anyone help me correct this code so when the workbook opens - it
displays the right sheet and the ListBox shows the focus on the first
name?

Thank you,

Rob
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox Property where 'focus' triggers selection Tony Bender Excel Programming 1 June 8th 09 04:36 PM
ActiveX Combo Box Focus CraigB[_2_] Excel Programming 0 February 23rd 09 04:04 PM
Listbox Item Focus Kagan Clearwater[_2_] Excel Programming 1 April 5th 07 08:12 PM
ActiveX comboboxes on worksheet (lost focus problems) [email protected] Excel Programming 5 February 13th 07 03:51 PM
removing selection focus in listbox Craig Wilks[_2_] Excel Programming 2 August 13th 03 12:15 PM


All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"