ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Command button continues to be visible! (https://www.excelbanter.com/excel-programming/418228-command-button-continues-visible.html)

CAPTGNVR[_2_]

Command button continues to be visible!
 

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

Peter T

Command button continues to be visible!
 
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




CAPTGNVR[_2_]

Command button continues to be visible!
 
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





Peter T

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







CAPTGNVR[_2_]

Command button continues to be visible!
 
D/Peter

Yes this code worked in the new sheet.

But I tried the same by placing a new command button and tried and the
command button continues to be seen.

Thnks for the folow up. Pls adv.

brgds/captgnvr

"Peter T" wrote:

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







Peter T

Command button continues to be visible!
 
Post the your code, I mean the actual code.

Regards,
Peter T

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

Yes this code worked in the new sheet.

But I tried the same by placing a new command button and tried and the
command button continues to be seen.

Thnks for the folow up. Pls adv.

brgds/captgnvr

"Peter T" wrote:

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









CAPTGNVR[_2_]

Command button continues to be visible!
 
D/Peter

sheets("sheet1").select

With ActiveSheet.alfa
.Visible = Not .Visible
End With




"Peter T" wrote:

Post the your code, I mean the actual code.

Regards,
Peter T

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

Yes this code worked in the new sheet.

But I tried the same by placing a new command button and tried and the
command button continues to be seen.

Thnks for the folow up. Pls adv.

brgds/captgnvr

"Peter T" wrote:

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










Peter T

Command button continues to be visible!
 
Are your sure the button is named "alfa", I don't mean as seen in the names
box left of input bar but in Properties. If the following works that's
confirm you have got your names mixed up.

With ActiveSheet.OLEObjects("alfa")
.Visible = Not .Visible
End With

Regards,
Peter T


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

sheets("sheet1").select

With ActiveSheet.alfa
.Visible = Not .Visible
End With




"Peter T" wrote:

Post the your code, I mean the actual code.

Regards,
Peter T

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

Yes this code worked in the new sheet.

But I tried the same by placing a new command button and tried and the
command button continues to be seen.

Thnks for the folow up. Pls adv.

brgds/captgnvr

"Peter T" wrote:

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












CAPTGNVR[_2_]

Command button continues to be visible!
 
D/Peter

The following did nto work.
With ActiveSheet.OLEObjects("alfa")
..Visible = Not .Visible
End With

The following works in a new worksheet
With ActiveSheet.OLEObjects("CommandButton1")
..Visible = Not .Visible
End With

Then I go back to my actual worksheet which is about 1.6mb file and put a
new commandbutton from the control toolbox and it does not work.

As I mentioned I have unprotected the sheet.

Tried so much and pls dont give up and help me as I am keen to know why if
it can work in a new work sheet why it is not working in the work sheet which
i am programming?

brgds/captgnvr




"Peter T" wrote:

Are your sure the button is named "alfa", I don't mean as seen in the names
box left of input bar but in Properties. If the following works that's
confirm you have got your names mixed up.

With ActiveSheet.OLEObjects("alfa")
.Visible = Not .Visible
End With

Regards,
Peter T


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

sheets("sheet1").select

With ActiveSheet.alfa
.Visible = Not .Visible
End With




"Peter T" wrote:

Post the your code, I mean the actual code.

Regards,
Peter T

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

Yes this code worked in the new sheet.

But I tried the same by placing a new command button and tried and the
command button continues to be seen.

Thnks for the folow up. Pls adv.

brgds/captgnvr

"Peter T" wrote:

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













Peter T

Command button continues to be visible!
 
When you added a new button did you rename it or leave it as the default
name (don't rename it).

Regards,
Peter T

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

The following did nto work.
With ActiveSheet.OLEObjects("alfa")
.Visible = Not .Visible
End With

The following works in a new worksheet
With ActiveSheet.OLEObjects("CommandButton1")
.Visible = Not .Visible
End With

Then I go back to my actual worksheet which is about 1.6mb file and put a
new commandbutton from the control toolbox and it does not work.

As I mentioned I have unprotected the sheet.

Tried so much and pls dont give up and help me as I am keen to know why if
it can work in a new work sheet why it is not working in the work sheet
which
i am programming?

brgds/captgnvr




"Peter T" wrote:

Are your sure the button is named "alfa", I don't mean as seen in the
names
box left of input bar but in Properties. If the following works that's
confirm you have got your names mixed up.

With ActiveSheet.OLEObjects("alfa")
.Visible = Not .Visible
End With

Regards,
Peter T


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

sheets("sheet1").select

With ActiveSheet.alfa
.Visible = Not .Visible
End With




"Peter T" wrote:

Post the your code, I mean the actual code.

Regards,
Peter T

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

Yes this code worked in the new sheet.

But I tried the same by placing a new command button and tried and
the
command button continues to be seen.

Thnks for the folow up. Pls adv.

brgds/captgnvr

"Peter T" wrote:

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















CAPTGNVR[_2_]

Command button continues to be visible!
 
D/Peter

As I mentioned, I just put the commandbutton and did not change the name.

In short, I just did the same in new worksheet it works and I do the same in
the worksheet I am programming it does not work.

When u going to sleep?? Shall I wait up??

brgds/captgnvr


"Peter T" wrote:

When you added a new button did you rename it or leave it as the default
name (don't rename it).

Regards,
Peter T

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

The following did nto work.
With ActiveSheet.OLEObjects("alfa")
.Visible = Not .Visible
End With

The following works in a new worksheet
With ActiveSheet.OLEObjects("CommandButton1")
.Visible = Not .Visible
End With

Then I go back to my actual worksheet which is about 1.6mb file and put a
new commandbutton from the control toolbox and it does not work.

As I mentioned I have unprotected the sheet.

Tried so much and pls dont give up and help me as I am keen to know why if
it can work in a new work sheet why it is not working in the work sheet
which
i am programming?

brgds/captgnvr




"Peter T" wrote:

Are your sure the button is named "alfa", I don't mean as seen in the
names
box left of input bar but in Properties. If the following works that's
confirm you have got your names mixed up.

With ActiveSheet.OLEObjects("alfa")
.Visible = Not .Visible
End With

Regards,
Peter T


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

sheets("sheet1").select

With ActiveSheet.alfa
.Visible = Not .Visible
End With




"Peter T" wrote:

Post the your code, I mean the actual code.

Regards,
Peter T

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

Yes this code worked in the new sheet.

But I tried the same by placing a new command button and tried and
the
command button continues to be seen.

Thnks for the folow up. Pls adv.

brgds/captgnvr

"Peter T" wrote:

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
















Peter T

Command button continues to be visible!
 
Try this

Sub test3()
Static b As Boolean
ActiveSheet.OLEObjects.Visible = b
b = Not b
End Sub

Regards,
Peter T


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

As I mentioned, I just put the commandbutton and did not change the name.

In short, I just did the same in new worksheet it works and I do the same
in
the worksheet I am programming it does not work.

When u going to sleep?? Shall I wait up??

brgds/captgnvr


"Peter T" wrote:

When you added a new button did you rename it or leave it as the default
name (don't rename it).

Regards,
Peter T

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

The following did nto work.
With ActiveSheet.OLEObjects("alfa")
.Visible = Not .Visible
End With

The following works in a new worksheet
With ActiveSheet.OLEObjects("CommandButton1")
.Visible = Not .Visible
End With

Then I go back to my actual worksheet which is about 1.6mb file and put
a
new commandbutton from the control toolbox and it does not work.

As I mentioned I have unprotected the sheet.

Tried so much and pls dont give up and help me as I am keen to know why
if
it can work in a new work sheet why it is not working in the work sheet
which
i am programming?

brgds/captgnvr




"Peter T" wrote:

Are your sure the button is named "alfa", I don't mean as seen in the
names
box left of input bar but in Properties. If the following works
that's
confirm you have got your names mixed up.

With ActiveSheet.OLEObjects("alfa")
.Visible = Not .Visible
End With

Regards,
Peter T


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

sheets("sheet1").select

With ActiveSheet.alfa
.Visible = Not .Visible
End With




"Peter T" wrote:

Post the your code, I mean the actual code.

Regards,
Peter T

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

Yes this code worked in the new sheet.

But I tried the same by placing a new command button and tried
and
the
command button continues to be seen.

Thnks for the folow up. Pls adv.

brgds/captgnvr

"Peter T" wrote:

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



















All times are GMT +1. The time now is 12:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com