Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Widening Columns in Chart | Charts and Charting in Excel | |||
widening a drop down box | Excel Worksheet Functions | |||
Cell displays '#######' despite column widening | Excel Discussion (Misc queries) | |||
Widening Cluster Chart Columns | Charts and Charting in Excel | |||
Widening Validation Box | Excel Worksheet Functions |