View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
helmekki[_81_] helmekki[_81_] is offline
external usenet poster
 
Posts: 1
Default Using VBA to disable macros when opening files


Try this: it will do the job
place this code in the main file then open the other files, so the
codes in the other files will not be excuted.

the code will open the other files and prevent excuting the codes
inside them


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

With Application
lngAutomation = .AutomationSecurity
.AutomationSecurity = msoAutomationSecurityForceDisable
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=384353