View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dale Fye Dale Fye is offline
external usenet poster
 
Posts: 169
Default Change CommandBarButton state not working


This was working yesterday, but now it is not. I have a custom popup menu
on a userform (this works great) that contains a PrintPreview button, that I
want to change the state from msoButtonUp to msoButtonDown, and reverse when
I click on the button. The following code was working, but now is not, any
ideas?

Public Sub FilePrintPreview()

Dim ctrl As CommandBarButton
Set ctrl = Application.CommandBars.FindControl(Tag:="FilePrin tPreview")

'Changes the buttons state from Down-Up or Up-Down
ctrl.State = IIf(ctrl.State = msoButtonDown, msoButtonUp, msoButtonDown)

End Sub

--
Don''t forget to rate the post if it was helpful!

Email address is not valid.
Please reply to newsgroup only.