Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Widening the Name Box -- need help

I need to widen the Name Box in Excel 2000.

I was adviised on these pages to visit Chip Person's web page
(http://www.cpearson.com/excel/NameBox.htm). His technique for doing so is
to create a "regular" module in the PERSONAL.xls workbook and put the code
below in it."

Then the subroutine, WidenNameBoxDrop2, is called from a Workbook_Open
procedure inserted in the "This Workbook" module of PERSONAL.xls.

I've done all this and nothing happens when I open a new workbook. What's
wrong?

Even if I step through the WidenNameBoxDrop2 procedure, nothing happens.

John Wirt

- - - - - - - - - - - - - - -
PEARSON'S CODE:

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 WidenNameBoxDrop2()
Dim Res As Long
Const CB_SETDROPPEDWIDTH = &H160
Const cWidth = 400 '<<<<<<<<<<<<<<<<<<<<<<
Res = SendMessage( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString), _
CB_SETDROPPEDWIDTH, cWidth, 0)
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Widening the Name Box -- need help

Hi John,

The box (or, rather, the dropdown display) should widen when the dropdown
arrow is clicked. Is this not happening for you?


---
Regards,
Norman



"John Wirt" wrote in message
...
I need to widen the Name Box in Excel 2000.

I was adviised on these pages to visit Chip Person's web page
(http://www.cpearson.com/excel/NameBox.htm). His technique for doing so is
to create a "regular" module in the PERSONAL.xls workbook and put the code
below in it."

Then the subroutine, WidenNameBoxDrop2, is called from a Workbook_Open
procedure inserted in the "This Workbook" module of PERSONAL.xls.

I've done all this and nothing happens when I open a new workbook. What's
wrong?

Even if I step through the WidenNameBoxDrop2 procedure, nothing happens.

John Wirt

- - - - - - - - - - - - - - -
PEARSON'S CODE:

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 WidenNameBoxDrop2()
Dim Res As Long
Const CB_SETDROPPEDWIDTH = &H160
Const cWidth = 400 '<<<<<<<<<<<<<<<<<<<<<<
Res = SendMessage( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString), _
CB_SETDROPPEDWIDTH, cWidth, 0)
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Widening the Name Box -- need help

John,

It won't happen when you open a new workbook, but rather the next time you
start Excel (and open Personal.xls).

--

HTH

RP
(remove nothere from the email address if mailing direct)


"John Wirt" wrote in message
...
I need to widen the Name Box in Excel 2000.

I was adviised on these pages to visit Chip Person's web page
(http://www.cpearson.com/excel/NameBox.htm). His technique for doing so is
to create a "regular" module in the PERSONAL.xls workbook and put the code
below in it."

Then the subroutine, WidenNameBoxDrop2, is called from a Workbook_Open
procedure inserted in the "This Workbook" module of PERSONAL.xls.

I've done all this and nothing happens when I open a new workbook. What's
wrong?

Even if I step through the WidenNameBoxDrop2 procedure, nothing happens.

John Wirt

- - - - - - - - - - - - - - -
PEARSON'S CODE:

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 WidenNameBoxDrop2()
Dim Res As Long
Const CB_SETDROPPEDWIDTH = &H160
Const cWidth = 400 '<<<<<<<<<<<<<<<<<<<<<<
Res = SendMessage( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString), _
CB_SETDROPPEDWIDTH, cWidth, 0)
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Widening the Name Box -- need help

John

An alternative to Chip's code...........

Robert Gelb has a free COM add-in that does this.

http://www.vbrad.com/pf.asp?p=Source...l_nb_addin.htm


Gord Dibben Excel MVP

On Wed, 22 Dec 2004 23:37:51 -0500, "John Wirt" wrote:

I need to widen the Name Box in Excel 2000.

I was adviised on these pages to visit Chip Person's web page
(http://www.cpearson.com/excel/NameBox.htm). His technique for doing so is
to create a "regular" module in the PERSONAL.xls workbook and put the code
below in it."

Then the subroutine, WidenNameBoxDrop2, is called from a Workbook_Open
procedure inserted in the "This Workbook" module of PERSONAL.xls.

I've done all this and nothing happens when I open a new workbook. What's
wrong?

Even if I step through the WidenNameBoxDrop2 procedure, nothing happens.

John Wirt

- - - - - - - - - - - - - - -
PEARSON'S CODE:

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 WidenNameBoxDrop2()
Dim Res As Long
Const CB_SETDROPPEDWIDTH = &H160
Const cWidth = 400 '<<<<<<<<<<<<<<<<<<<<<<
Res = SendMessage( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString), _
CB_SETDROPPEDWIDTH, cWidth, 0)
End Sub


Reply
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
Widening Columns in Chart Hoosierquilt Charts and Charting in Excel 7 May 9th 07 08:50 PM
widening a drop down box Mick Elliott Excel Worksheet Functions 1 April 9th 07 10:40 PM
Cell displays '#######' despite column widening Pedros Excel Discussion (Misc queries) 5 February 7th 06 02:22 AM
Widening Cluster Chart Columns toilinthedark Charts and Charting in Excel 2 October 31st 05 08:36 PM
Widening Validation Box Alex Mackenzie Excel Worksheet Functions 1 October 21st 05 05:16 PM


All times are GMT +1. The time now is 11:07 PM.

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

About Us

"It's about Microsoft Excel"