Making Command Button invisible from within the click-event

  • I am having problems in making a command button invisible (worksheet, not form) after it has been clicked (Excel 2007). I tried this :


    without effect. I imagine the click-event is refusing to hide its own object because it is still executing.

  • Re: Making Command Button invisible from within the click-event


    DJ,


    Just use


    Code
    ShowAsGraph_Click()
    ActiveSheet.ChartObjects("Dashboard_Chart").Visible = true
    Showasgraph.Visible = false
    
    
    End sub


    aisietie

  • Re: Making Command Button invisible from within the click-event


    Thanks aisietie, that did the trick. (Still can't see why refering to it as its shape-object doesn't work and the direct reference does. Who cares!)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!