Excel Interop to open excel with macros disabled

Is there a way in C# to switch off macros in excel before loading an excel file. I am loading the excel file using Excel Interop. All I can see is solutions for VB.NET.

Thanks Nishant

Answers


I think you can just set it on your Excel Application:

Excel.Application xapp = new Excel.Application();
xapp.AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable;

Need Your Help

The workspace version table contains an unknown schema version

tfs visual-studio-2012 tfs2012

Just started up Visual Studio 2012 and opened my solution which is in source control with Team Foundation Server 2012 Express and encountered this, any ideas? Can't get latest, can't check in, ever...

Set bootstrap modal body height by percentage

html css css3 twitter-bootstrap modal-dialog

I am trying to make a modal with a body that will scroll when the content becomes too large. However, I want the modal to be responsive to the screen size. When I set the max-height to 40% it has no