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?
 
Sandra FrongilloConnect With a Mentor Senior 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
 
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
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
Martin LissOlder than dirtCommented:
The code here seems to be tan expansion of your code. Give it a try.
0
 
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:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.