How to reenable macros upon exit of workbook so users are prompted to enable macros each and every time they open the Excel workbook

Force users to enable macros when opening excel 2013 worksheet to see hidden sheets but resets the macro when exiting so if they open it again, they get prompted again to enable macros.  Right now the code I have works once but remembers that I enabled the macro and when I reopen the worksheet I'm no longer prompted to enable macros.
ForceMacro_V2_2018-04-30.xlsm
Sandra FrongilloSenior Business AnalystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
When opening your workbook in Excel 2010, I'm always prompted to enable macros. Also, why do you hide the sheets on Close when you are opening them on Open? The net result of not doing either would be to have the sheets show up, which seems to be what you want to have happen.
0
Sandra FrongilloSenior Business AnalystAuthor Commented:
Trying to force users to enable macros so we can track who is using the spreadsheet.  That part of the macro only works if users enable the macro.  Users can bypass the tracking macro if they don't turn it on currently and still see the report data.  By hiding the additional sheets it will force someone to enable the macros to get to their report and thus track who opened it. :)
0
Martin LissOlder than dirtCommented:
The code here seems to be tan expansion of your code. Give it a try.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Sandra FrongilloSenior Business AnalystAuthor Commented:
That method doesn't work.  When you close out of the macro, it doesn't close all the way out of Excel and I have to right mouse click on Excel icon in the task bar to close the Excel otherwise you are left with a gray Excel shell with no "X" to close.  Not the cut/paste I was looking for but I'll see if I can monkey that code to work.
0
Sandra FrongilloSenior Business AnalystAuthor Commented:
I've tested the macro.  Even though it is no longer prompting me to turn on macros, it is still capturing the opening. Therefore my original macro was working.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sandra FrongilloSenior Business AnalystAuthor Commented:
In testing my original macro - it was already doing what I needed even though it was no longer prompting me for the enable macros warning
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.