Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!g1g2000pra.googlegroups.com!not-for-mail
From: fhirsch@entrerock.com
Newsgroups: comp.soft-sys.matlab
Subject: Re: Disable Excel Macro
Date: Thu, 8 Jan 2009 07:58:32 -0800 (PST)
Organization: http://groups.google.com
Lines: 21
Message-ID: <958241c5-af9f-4ebc-8dfd-952ab5838dd7@g1g2000pra.googlegroups.com>
References: <gjv9nq$1v8$1@fred.mathworks.com> <gjvata$otq$1@fred.mathworks.com> 
	<266b8f39-1e44-42bb-b0af-b5de1ac25259@z27g2000prd.googlegroups.com> 
	<gjvtdt$rmv$1@fred.mathworks.com> <gk1ot1$3t5$1@fred.mathworks.com> 
	<gk1q82$o4c$1@fred.mathworks.com> <gk23lu$mdk$1@fred.mathworks.com>
NNTP-Posting-Host: 98.213.161.64
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1231430313 31112 127.0.0.1 (8 Jan 2009 15:58:33 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 8 Jan 2009 15:58:33 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: g1g2000pra.googlegroups.com; posting-host=98.213.161.64; 
	posting-account=0fPUXwoAAABMxgUHtUssQrRZhPeAOyxI
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 
	1.1.4322; .NET CLR 2.0.50727; InfoPath.2),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:510444


Perhaps you could go check out the Application.automationSecurity
object in Excel 2007
This example is from VBA help in Excel 2007

This example captures the current automation security setting, changes
the setting to disable macros, displays the Open dialog box, and after
opening the selected document, sets the automation security back to
its original setting.

Microsoft Visual Basic for Applications
Sub Security()
    Dim secAutomation As MsoAutomationSecurity

    secAutomation = Application.AutomationSecurity

    Application.AutomationSecurity = msoAutomationSecurityForceDisable
    Application.FileDialog(msoFileDialogOpen).Show

    Application.AutomationSecurity = secAutomation

End Sub