View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
filo666 filo666 is offline
external usenet poster
 
Posts: 265
Default Chanagin buttons images

pd. appears a strange error:
Compile error
method or data member not found

"K Dales" wrote:

An easier way to set this up would be to create three different buttons (and
associated macros) and set them beside each other, then use the
CommandButton.Visible property to selectively make them appear and disappear;
to the user this would have the same functionality:

Sub MyButton1_Click()
' Put your code here
CommandBars("MyBar").CommandButtons("MyButton1").V isible = False
CommandBars("MyBar").CommandButtons("MyButton2").V isible = True
End Sub

Sub MyButton2_Click()
' Put your code here
CommandBars("MyBar").CommandButtons("MyButton2").V isible = False
CommandBars("MyBar").CommandButtons("MyButton3").V isible = True
End Sub

Sub MyButton3_Click()
' Put your code here
CommandBars("MyBar").CommandButtons("MyButton3").V isible = False
CommandBars("MyBar").CommandButtons("MyButton1").V isible = True
End Sub

"filo666" wrote:

Hi, I made a custom toolbar, I want when a user clicks one button appears an
image (and a macro is executed), when he presses again (the same button)
appears another button image and another macro is executed and finally when
he presss it again (the same button), execut another macro and the first
button image appears. How Could I do this???