Thread: Name Box
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Name Box

You'd have to use a macro to do (this except in Excel 2007):

''From Chip Pearson's site
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal Wparam As Long, Lparam As Any) As Long

Sub WidenNameBoxDropDown()
Dim Res As Long
If Val(Application.Version) < 12 Then
Const CB_SETDROPPEDWIDTH = &H160
Dim cWidth As Integer
cWidth = 200
Res = SendMessage( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString), _
CB_SETDROPPEDWIDTH, cWidth, 0)
End If
End Sub


--
Jim
"Filips Benoit" wrote in message
...
Dear All,

Is it possible to make the Name Box wider ?

Filip