Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2006

Tip: Looking for answers? Try searching our database.

How to list objects defined - buttons, etc.?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
G Lykos - 17 Dec 2006 08:40 GMT
Greetings!  Is there a way to create a list of the objects, such as buttons,
defined in a workbook?

Thanks,
George
Helmut Weber - 17 Dec 2006 08:57 GMT
Hi George,

maybe you are looking for something
along these lines:

Sub Test90023()
Dim oSht As Worksheet
Set oSht = ActiveSheet
Dim lCnt As Long
For lCnt = 1 To oSht.Shapes.Count
  If oSht.Shapes(lCnt).Type = msoFormControl Then
     MsgBox oSht.Shapes(lCnt).FormControlType
  End If
Next
End Sub

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Bob Phillips - 17 Dec 2006 13:24 GMT
A bit more generic

Sub Test90023()
Dim oSht As Worksheet
Set oSht = ActiveSheet
Dim lCnt As Long
For lCnt = 1 To oSht.Shapes.Count
  MsgBox oSht.Shapes(lCnt).Name & " at " &
oSht.Shapes(lCnt).TopLeftCell.Address
Next
End Sub

Signature

---
HTH

Bob

(change the xxxx to gmail if mailing direct)

> Hi George,
>
[quoted text clipped - 11 lines]
> Next
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.