Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default control button numbers (ID=???)

Updated to be more generic, more permanent

Sub test()
Dim ocb As CommandBar
Dim ctl As CommandBarControl
Dim i As Long, j As Long

i = 1
j = 1
ActiveSheet.Cells.ClearContents
For Each ocb In Application.CommandBars
Cells(i, j).Value = ocb.Name
Cells(i, j).Font.Bold = True
i = i + 1
For Each ctl In ocb.Controls
Cells(i, j) = CStr(ctl.ID) & " - " & ctl.Caption
i = i + 1
Next ctl
j = j + 1
i = 1
Next ocb
ActiveSheet.Columns.AutoFit
End Sub

writes the data to a worksheet

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"brym" wrote in message
...
Is this what you're looking for:

Sub test()
Dim ctl
For Each ctl In CommandBars("Standard").Controls
Debug.Print ctl.Caption, CStr(ctl.Id)
Next ctl
End Sub

"mcpheat" skrev i en meddelelse
...
Hi there
Can someone point me to a list of ALL ID numbers for control buttons
indicating what they are so I can create a custom list. I am wanting to
either
"delete" or "hide" the worksheet menu bar (or modify it on open) and

then
"restore" it back to it's former self on closure of the spreadsheet.
I am using xl97.

Thanks to whoever can help me!








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
Button in Form Control SJL New Users to Excel 1 December 30th 09 09:30 PM
Control Button jai Excel Discussion (Misc queries) 2 August 25th 07 07:26 AM
Control button / macro Sarah Excel Discussion (Misc queries) 2 February 11th 07 04:45 AM
Control box and button oxicottin Excel Discussion (Misc queries) 4 January 23rd 07 03:03 PM
Control Toolbox button PBS Excel Discussion (Misc queries) 1 March 21st 06 11:39 PM


All times are GMT +1. The time now is 02:54 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"