• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to Enable Macro

Debraj

Excel Ninja
When I open the workbook (obviously *.xlsm),

and in hurry, without enabling the macro,

I press (Alt+F11) (I don't know why, but notification for 'enable Macro' disappear) ,

I made desire changes, and when I press F8 / F9, it remind me to reopen the sheet.


so far is good from the malicious point of view. but why reopen?..

Is there any option to enable macro when I was in VBA Editor Mode.., or to reappear the Notification pop-up..
 
You can check your macro settings

Whether the option "Enable all macros (not recommended;potentially dangerous code can run)" selected?
 
@nazmul.. Please read the question carefully, before any post.

* I never select Enable all macros in any case.

* thats why my system ask me everytime by the notification.

* I only prefer some of my folder to set as trusted location.

* Open a macro sheet, so that system ask you for enable. without enable just go to VBA editor. My problem is after go to VBA editor, how to enable Macro security setting without re-opening the Excel file..


Thanks for your help..
 
Unfortunately, due to Microsoft's security, you'll need to enable macros upon first opening, or do a save & re-open. There is no work around.
 
:( Thanks buddy..

I found a object 'Application.MacroOption', but unable to digest it properly.. Can you please give a look in 'Excel Developer Reference - Application.MacroOptions Method' and help me..


Is there no any option like "Application.EnableMacro = True" so that i can write in Immidiate window...
 
Looks like MacroOptions is a way to manipulate what is normally seen in the Macro menu in the workbook, seen when you hit Alt+F8. You can use this method to assign names, shortcut keys, etc.


You can't enable macros via VB. Again, from a security standpoint, that would be bad and could be exploited for for malicious purposed.
 
Hi, Debraj Roy!


Adding to what Luke M correctly wrote, you can't enable macros from VB but you can change the security mode for macros with:

Application.AutomationSecurity = <value>

with <value>:

msoAutomationSecurityLow (1), all allowed

msoAutomationSecurityByUI (2), default set by options

msoAutomationSecurityForceDisable (3), no macros


Regards!
 
Back
Top