Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Defined Name Box Shortcut

I got this from Chip Pearsonīs site, but donīt works for me (Win XP,
Excel 2003 portuguese).

Public Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As
Long
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


Sub SetFocusNameBox()
Dim Res As Long
Res = SetFocus( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString))
End Sub

Then I tried this and worked:

Sub DefinedNames()
Application.Dialogs(xlDialogDefineName).Show , "=" & ActiveSheet.Name &
"!" & ActiveCell.Address
End Sub

What am I missing?

Thanks
Hamilton R. Romano

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Defined Name Box Shortcut

Did you assign a shortcut key to the SetFocusNameBox macro?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


wrote in message
ups.com...
I got this from Chip Pearsonīs site, but donīt works for me (Win
XP,
Excel 2003 portuguese).

Public Declare Function SetFocus Lib "user32" (ByVal hwnd As
Long) As
Long
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


Sub SetFocusNameBox()
Dim Res As Long
Res = SetFocus( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString))
End Sub

Then I tried this and worked:

Sub DefinedNames()
Application.Dialogs(xlDialogDefineName).Show , "=" &
ActiveSheet.Name &
"!" & ActiveCell.Address
End Sub

What am I missing?

Thanks
Hamilton R. Romano


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Defined Name Box Shortcut

You could also try Ctrl-F3

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
ups.com...
I got this from Chip Pearsonīs site, but donīt works for me (Win XP,
Excel 2003 portuguese).

Public Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As
Long
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


Sub SetFocusNameBox()
Dim Res As Long
Res = SetFocus( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString))
End Sub

Then I tried this and worked:

Sub DefinedNames()
Application.Dialogs(xlDialogDefineName).Show , "=" & ActiveSheet.Name &
"!" & ActiveCell.Address
End Sub

What am I missing?

Thanks
Hamilton R. Romano


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
Run-time error '50290': Application-defined or object-defined erro Macro button Excel Discussion (Misc queries) 1 March 12th 09 10:59 AM
Application-Defined or Object-Defined Error on simple code Fid[_2_] Excel Programming 1 July 21st 05 08:30 PM
Application-Defined or Object-Defined Error on simple code [email protected] Excel Programming 6 February 22nd 05 09:03 PM
Application-defined or object-defined error on copy Josh Sale Excel Programming 1 February 3rd 05 01:40 AM
Application-defined or object-defined error - missing the basics [email protected] Excel Programming 1 December 28th 04 10:23 PM


All times are GMT +1. The time now is 02:20 AM.

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"