Code to Enable Macros

H

helmekki

Hi there

I am using this code it works only when Excel Macros are
enabled.........so what is the point of excuting this code while Excel
macros are enabled.

when excuting this code it askes to open a xl file, so the code opens
the file with macros either enabled or disabled......but this code
works only if Excel Macros are enabled, otherwise this code will not
work.........

The code :

Code:
--------------------
Sub Security()
Dim lngAutomation As MsoAutomationSecurity

With Application
lngAutomation = .AutomationSecurity
'.AutomationSecurity = msoAutomationSecurityForceDisable
.AutomationSecurity = msoAutomationSecurityLow
With .FileDialog(msoFileDialogOpen)
.Show
.Execute
End With
.AutomationSecurity = lngAutomation
End With

End Sub
 
L

Leith Ross

Hello Hesham,

As you pointed out, its value in VBA is senseless. However, in other
langauges, like Visual Basic, C++, Java Script, and some others, that
can be compiled, is it very valuable tool.

Sincerely,
Leith Ross
 

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