Issue with command button visibility

R

robs3131

Hi all - I'm reposting a question as I had not received a response. Just
wondering if anyone can help. Thx!

------------------
Hi all,

I have a command button where I'm setting .visible = false -- the problem is
that the button is still visible, even though the visible property was set to
false. It becomes invisible only after I enter design mode and then exit out
of design mode - then the .visible = false property kicks in. Any ideas why?
Thanks ahead of time. Below is from my code -- there is other code around
this but I don't think it would affect this issue (pasting all the code would
be a lot to go through). I thought the issue might have to do with how I set
Application.ScreenUpdating = True and then False in the middle of the sub (at
the beginning of the sub it is set to False and at the very end it is set
back to True), but when I commented this out, I still had the issue.


'Update sheet so user can see records highlighted in bold
Application.ScreenUpdating = True
Application.ScreenUpdating = False
'Run modules to update the Payment Master sheet
Module11.perfadvidassign
Module11.untiedpaysales
'Update 'Main Menu' so that "red" button is hidden
With Sheets("Performics Invoices not tied")
If .Range("A65536").End(xlUp).Address() = .Range("A1").Address()
Then
With Sheets("Main Menu")
'Change Font of cell to white
With .Range("C9").Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 2
End With
Sheets("Main Menu").Activate
With ActiveSheet.Shapes("perfopeninvoices")
.Visible = False
End With
With ActiveSheet.Shapes("perfpayin")
.Top = 225
.Left = 246
End With
End With
Else
End If
End With
Sheets("Performics Invoices not tied").Activate

'Show message box notifying the user that the records have been
submitted
MsgBox "Selected Invoices (those in bold) have been tied out"
 
S

Susan

i tried a control toolbox command button, and changing the visible
property to false does indeed make it invisible.

formatting a shape does not give you the property .visible to
change.

looking @ the vba editor object browser, it occurs to me that perhaps
you need to dim the shape as an oleobject.

although it does show shape has a .visible property:
Property Visible As MsoTriState

perhaps you haven't identified the shapes & so it isn't finding them.
when you step through, does the intellisense tell you which shape
you're targetting?

just some ideas
:)
susan
 
D

Dave Peterson

Maybe turning on screenupdating
changing the .visible to false
and turning off screenupdating

would allow excel to update the screen for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top