View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Command button continues to be visible!

In a new sheet add a button named CommandButton1 and run the following from
an ordinary module, obviously with the sheet active.

With ActiveSheet.CommandButton1
.Visible = Not .Visible
End With

For me this toggles visibility of the button in Excel-97, as expected.

Regards,
Peter

PS, what does D/Pter mean


"CAPTGNVR" wrote in message
...
D/Pter

After your suggestion about the design mode checked it is not in design
mode
and also ensured that the sheet is not protected.

The below line works
Activesheet.alfa.caption= "bingo"

The below line does not work
Activesheet.alfa.Visible = False

Using Excel 97.

Why I require it to be visible is bcos it is a big command button and want
to be visible only when export operations are going on. So I used this
above
code at the end of the procedure so that once the code is run they dont
see
this command button.

Pls help, as I will be watching with curiosity as dont understand why it
is
not working.

brgds/captgnvr




"Peter T" wrote:

That works fine for me in Excel-97. Going into design mode might make it
visible until exiting

Regards,
Peter T

"CAPTGNVR" wrote in message
...

Dear All
The following code does not give any errors but the command button
named
as
'alfa' continues to be visible in excel-97; command button from control
toolbox.

Activesheet.alfa.Visible = False

Pls advice.

brgds/captgnvr