#1   Report Post  
Posted to microsoft.public.excel.programming
luc luc is offline
external usenet poster
 
Posts: 15
Default button

how can i check if a button already exists in a certain sheet on opening of
a file?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default button

What sort of button, forms, control tolbox?

If the former try

Dim oBtn As Object

On Error Resume Next
Set oBtn = ActiveSheet.Buttons("Button 1")
If Not oBtn Is Nothing Then
MsgBox "Button 1 already exists"
End If

If the latter, then

Dim oOLE As Object

On Error Resume Next
Set oOLE = ActiveSheet.OLEObjects("CommandButton1")
If Not oOLE Is Nothing Then
MsgBox "already exists"
End If


--

HTH

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


"luc" wrote in message
...
how can i check if a button already exists in a certain sheet on opening

of
a file?




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
Inserting a Graphic on a Button when the Button is Assigned to a M smck Excel Discussion (Misc queries) 2 October 27th 09 04:46 PM
insert row above button (retrieve position of button) Max Excel Discussion (Misc queries) 3 November 7th 07 06:27 PM
How do I lock a radio button group if a N/A button is selected worry a lot Excel Discussion (Misc queries) 2 May 21st 05 08:33 PM
Can't select macro button after other button is pressed C. Campbell Excel Programming 1 November 30th 04 07:46 PM
Delete a custom button by holding down the ALT key and dragging the button off the toolbar Stephen[_8_] Excel Programming 0 April 4th 04 02:22 PM


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