enabling macros from command line

D

Denis

I need to automate some Excel processing via macros so that a job can
just be scheduled to run without any user involvement. For this to
work, macros have to be enabled. Unfortunately, I know of only one
way to do this that doesn't involve interaction from the user -
setting the security level to low.

Is there any other way around this? Ideally, there would be a command
line option that would enable macros but I haven't found anything.
Setting the security level to low will obviously work but it's not a
good solution. Any other possibility?

Denis
 
N

Nigel

You cannot. Would you really want a program to be able to change the
security settings!

The alternative is to create a digitally signed macros and /or set trusted
sources
 
J

Jim Rech

Write a VBS (or other) script that creates an instance of Excel that then
opens your workbook. Macros in it will be enabled regardless of the user's
security settings. You can have your code called from the Workbook Open
event in the workbook or you can use RUN to execute the code.
--
Jim
|I need to automate some Excel processing via macros so that a job can
| just be scheduled to run without any user involvement. For this to
| work, macros have to be enabled. Unfortunately, I know of only one
| way to do this that doesn't involve interaction from the user -
| setting the security level to low.
|
| Is there any other way around this? Ideally, there would be a command
| line option that would enable macros but I haven't found anything.
| Setting the security level to low will obviously work but it's not a
| good solution. Any other possibility?
|
| Denis
 
R

Ron de Bruin

Hi Jim

Do I remind this correct ?

As far as I know you must enable the first VBS script you run on your computer one time (a msgbox I believe).
 
D

Denis

Write a VBS (or other) script that creates an instance of Excel that then
opens your workbook. Macros in it will be enabled regardless of the user's
security settings. You can have your code called from the Workbook Open
event in the workbook or you can use RUN to execute the code.

Great. I just did a little test case opening a .xls with a
Workbook_Open macro and it worked as advertised. Thanks a bunch.

Denis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top