View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
helmekki[_100_] helmekki[_100_] is offline
external usenet poster
 
Posts: 1
Default 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