Thank you for your reply
I have entered the code you provided within my "Disable" macro (shown below)
Sub Disable()
'
' Disable Macro
' Macro recorded 05/02/2010 by enahs naneek
'
'
If ActiveSheet.Shapes("CommandButton1").Enabled = True Then
ActiveSheet.Shapes("CommandButton1").Enabled = False
Else
ActiveSheet.Shapes("CommandButton1").Enabled = True
End If
End Sub
Results in error message "object doesnt support this property or method"
This macro (forming part of a larger macro) will be assigned to a second
command button so that when the full macro process is complete i can either
disable or enable the first command button by editing the code to what is
required (true or false)
e.g. "Add" command button enables or disables "Edit" command button.
Will the code you provided work this way
Much appreciated
______________________________________________________
Per said:
Hi
You don't have to select the button to enable/disable it, just use the
object reference as recorded:
If Activesheet.Shapes("CommandButton1").Enabled=true then
Activesheet.Shapes("CommandButton1").Enabled=False
Else
Activesheet.Shapes("CommandButton1").Enabled=True
End If
Hopes this helps.
...
Per
I have tried to create a macro using recorder to disable/enable command
button (ActiveX) with the following code being created
[quoted text clipped - 13 lines]
Any help much appreciated