Sunday, March 24, 2019

microsoft excel - Enable Macros after message box closes



Is there a way to enable Macros after the message bar with the Enable Macros button has closed?



I opened the Excel file and immediately went to edit the VBA. When I went to run the VBA, it stated,




The macros in this project are disabled. ...





and




Because of your security settings, macros have been disabled. To run macros, you need to re-open this workbook, and then choose to enable macros. ...




To get the Macro to run, I had to close the file and reopen the file to get the message bar and click the button to enable macros. While that procedure is not terribly painful, it is inconvenient.




I could allow ALL macros to run, but I would prefer to keep some security against malicious code.



Is there a way to get the message bar and/or Enable Macros button to reappear without reopening the file?


Answer



If you trust the workbook running macros.




  1. Go to the Developer tab


  2. Click Macro Security
    Screenshot for steps 1 and 2



  3. Change it to enable all macros
    Screenshot steps 5 and 6




As far as I can tell, there is not way to make the "Enable Macros" button reappear.



We run macros frequently at work and do not open unknown files. So this works well and bypasses the "Enable Macros" message bar completely.



When you're done, you can always set it back to "not allow macros with notification".




This will solve your issue of having to reopen your file at least.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...