L luc Dec 25, 2004 #1 how can i check if a button already exists in a certain sheet on opening of a file?
B Bob Phillips Dec 25, 2004 #2 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)
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)