ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide Custom Command Bar if Workbook opened Read-Only (https://www.excelbanter.com/excel-programming/410075-hide-custom-command-bar-if-workbook-opened-read-only.html)

[email protected]

Hide Custom Command Bar if Workbook opened Read-Only
 
When I open my workbook read-only, the macro listed below runs. How
do I also have my custom command bar hide as well?

Sub ShowAffOnly()
Dim wsSheet As Worksheet
For Each wsSheet In Worksheets
If wsSheet.Name < "Affiliation" Then wsSheet.Visible = xlVeryHidden
Next wsSheet
End Sub

Bob Phillips

Hide Custom Command Bar if Workbook opened Read-Only
 
Application.Commandbars("MyCustom").Visible = False

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
...
When I open my workbook read-only, the macro listed below runs. How
do I also have my custom command bar hide as well?

Sub ShowAffOnly()
Dim wsSheet As Worksheet
For Each wsSheet In Worksheets
If wsSheet.Name < "Affiliation" Then wsSheet.Visible = xlVeryHidden
Next wsSheet
End Sub




[email protected]

Hide Custom Command Bar if Workbook opened Read-Only
 
On Apr 28, 3:59*am, "Bob Phillips" wrote:
Application.Commandbars("MyCustom").Visible = False

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message

...



When I open my workbookread-only, the macro listed below runs. * How
do I also have my custom command bar hide as well?


Sub ShowAffOnly()
Dim wsSheet As Worksheet
For Each wsSheet In Worksheets
IfwsSheet.Name < "Affiliation" Then wsSheet.Visible = xlVeryHidden
Next wsSheet
End Sub- Hide quoted text -


- Show quoted text -


Thank you so much. I wish I would learn to quit making it harder than
it is.


All times are GMT +1. The time now is 05:54 AM.

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