LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.
 
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
Detecting Change in State of Internet Explorer Ash Excel Programming 9 October 9th 06 02:28 AM
' Invoice' , change ' State and ZIP' to 'Prov and PC' How? Reirson Excel Discussion (Misc queries) 1 February 3rd 06 07:40 PM
trouble with commandbarbutton.state Wazooli Excel Programming 1 May 26th 05 09:18 PM
how to change the state of a number in a cell from negative to po. Steve11 Excel Discussion (Misc queries) 1 November 29th 04 07:00 AM
Change ReadOnly State Jos Vens Excel Programming 2 November 17th 03 10:35 PM


All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"