Solved automatically enable macros on excel spreadsheet start

December 4, 2014 at 16:44:59
Specs: Windows 7
Spreadsheet contains macros. On startup of any spreadsheet the macros are disabled. To activate macros need to select option before proceeding. I thought to record macro to carry out this function. However the selecttion to OK a macro is disabled and removed from options after it has been selected hence cannot access to record. Code to acheive enable on startup needed. recall "autoexec" or similar macro needed with appropriate code.

See More: automatically enable macros on excel spreadsheet start

Report •


✔ Best Answer
December 5, 2014 at 08:16:22
re: "...thought it could be turned off for a particular file"

It can be...sort off. I can't test any of these options at the moment, so I'm working from memory.

Option 1:

I believe that the "Disable all macros with notification" option will check each file and present a warning if the file contains a macro. I believe that the user is given the option to enable macros just for that file but it might be for just that session. At least the user wouldn't have to go into the Trust Center every time. See here:

https://faculty.fuqua.duke.edu/~pec...

Option 2:

See this site about storing files in a Trusted Location. When a Trusted Location is used, the macro security settings in Excel are essentially ignored, thereby enabling macros for any files stored there.

https://support.office.com/en-us/ar...

Option 3:

There is also a means to Digital Sign a workbook containing macros as a workaround for this issue, but I am not familiar with the process. You might want to Google around to see if that option might work. I believe that the user has to create the workbook that they want to sign, so I don't know if that even fits your situation.

Good luck!

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.



#1
December 4, 2014 at 17:22:15
You cannot use a macro to enable macros. Imagine what would happen if you could...

Let's say you have chosen not to enable macros your own system for security reasons. I could send you a spreadsheet that contains a macro with dangerous code built in, code that could harm your overall system. If I was able to "force" your system to run that macro by enabling macros via code, then I could override your own choice to not have macros enabled.

The only way to have macros enabled on a system is for a user to manually choose the options via the Excel Options menu.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
December 4, 2014 at 19:08:13
Thanks...had the feeling that might be the case and understand your logic. However I cannot recall having this "problem" some years ago when I used excel macros a lot (retired 6 years ago so am very rusty). Perhaps this is a feature that didn't exist in earlier version of excel. I have no problem with the process but my wife gets very annoyed having to find command when she forgets.
Again thanks for help.

Report •

#3
December 4, 2014 at 20:25:50
re: Perhaps this is a feature that didn't exist in earlier version of excel.

I don't recall any version of Excel that allowed macros to run automatically unless the user set the option to allow it.

re: I have no problem with the process but my wife gets very annoyed having to find command when she forgets.

You don't have to set it every time you open a workbook with a macro. You can set it once and forget it. If you do this, you should make sure you have a decent virus protection program running which should detect the malicious code when the file is received.

Assuming Excel 2007 or later, refer to these instructions and make the choice that you feel most comfortable with:

http://www.addictivetips.com/window...

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Related Solutions

#4
December 5, 2014 at 04:59:36
Agree there was always a macro protection but thought it could be turned off for a particular file (as I said I am rusty and more surprised at how much I do remember rather than the lapses!! Looking back, the last major project I worked on using Excel VBA and VB was 1999 with a littlle dabbling afterwards).
The option specified it the "addictivetips" instructions seems to be a global on/off for all files rather than my wish to do so for the selected file only. However I will follow up further.
Again thanks for your help - even if not satisfying my wish I have found it valuable.

Report •

#5
December 5, 2014 at 08:16:22
✔ Best Answer
re: "...thought it could be turned off for a particular file"

It can be...sort off. I can't test any of these options at the moment, so I'm working from memory.

Option 1:

I believe that the "Disable all macros with notification" option will check each file and present a warning if the file contains a macro. I believe that the user is given the option to enable macros just for that file but it might be for just that session. At least the user wouldn't have to go into the Trust Center every time. See here:

https://faculty.fuqua.duke.edu/~pec...

Option 2:

See this site about storing files in a Trusted Location. When a Trusted Location is used, the macro security settings in Excel are essentially ignored, thereby enabling macros for any files stored there.

https://support.office.com/en-us/ar...

Option 3:

There is also a means to Digital Sign a workbook containing macros as a workaround for this issue, but I am not familiar with the process. You might want to Google around to see if that option might work. I believe that the user has to create the workbook that they want to sign, so I don't know if that even fits your situation.

Good luck!

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •


Ask Question