ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to Enable Macros (https://www.excelbanter.com/excel-programming/344317-code-enable-macros.html)

helmekki[_100_]

Code to Enable Macros
 

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
--------------------


--
helmekki


------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=480751


Leith Ross[_177_]

Code to Enable Macros
 

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


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=480751



All times are GMT +1. The time now is 07:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com