VBA Excel for Mac shows very hidden sheet when disabled macro button is pushed

Raul_Rodriguez

New Member
Joined
Aug 13, 2018
Messages
2
So, I have a very simple code:
Code:
Private Sub Worrkbook_Open()
Application.screenupdating=false
Application.DisplayWarnings = false
Application.Thisworkbook.Worksheets("Sheet1").visible=xlSheetVeryHidden
End Sub

Private Sub Workbook_Close()
Application.screenupdating=True
Application.DisplayWarnings = Ture
End Sub
It works fine in Excel for windows, however, in Excel VBA for Mac when user selects Disable macros, the hidden sheet is displayed. Is there anything else I should account for in a Mac ?
Your help is greatly appreciated

RR
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hello Raul_Rodriguez,

Welcome to MrExcel.com!

It looks like your workbook in Mac is saved when Sheet1 is not hidden. So when you disable macros, Excel has no way to make it hidden. If the Excel workbook you are using in Windows works then it should have been saved when Sheet1 is already hidden.

(Please note that it is not Worrkbook_Open, but Workbook_Open, and DisplayWarnings is DisplayAlerts, finally Ture should be True in the Workbook_Close event in your code).
 
Upvote 0
Hello Raul_Rodriguez,

Welcome to MrExcel.com!

It looks like your workbook in Mac is saved when Sheet1 is not hidden. So when you disable macros, Excel has no way to make it hidden. If the Excel workbook you are using in Windows works then it should have been saved when Sheet1 is already hidden.

(Please note that it is not Worrkbook_Open, but Workbook_Open, and DisplayWarnings is DisplayAlerts, finally Ture should be True in the Workbook_Close event in your code).

That was it, it was not previously saved!! Rookie mistake. Any how thank you, the rest were typos on my posting compare to the real code on the file; And yes I did have DisplayAlerts no DisplayWarnings as I had written on the post. My bad, that can be misleading, I will be more mindful on my next posting.
 
Upvote 0
You're welcome!

About the typos - I figured those are typos, but on the other side this page will be indexed in search engines, and other people who is seeking for help will likely visit this subject. It is better to explain that there is actually no DisplayWarnings method in VBA to avoid confusion for them - just as you said. That's why I put that note separately, not to correct you actually. In fact, I admire coders who directly types in the post editor, it is not something easy to do.

Glad to hear you got your problem is solved. And once again, welcome to the board!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,775
Messages
6,174,458
Members
452,566
Latest member
Bonnie_bb

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top