View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Macro Security Settings and C#

Matt,

Remove the macros from the workbook, and do everything from your application. There's nothing that
you can't do from outside Excel that a macro can do from inside Excel.

HTH,
Bernie
MS Excel MVP


"Matt Hartzell" <Matt wrote in message
...
Hi,

I am a software developer trying to embed an Excel workbook into our
existing application. I am currently using the DSOFramer to do this. It
works well, except that our customized .xls files will contain macros. We
need the embedded workbook to be as seamless as possible, so I am trying to
figure out how to prevent the Enable/Disable Macros dialog box from opening
when I attempt to open an .xls file in the DSOFramer.

In short: How can I prevent the Enable/Disable Macros security box from
appearing in a programmatic manner? Can I access the Excel security settings
from .NET? Is there some other way to prevent this box from appearing?

I feel like I've tried everything. I've even tried starting a background
thread that only does SendKey.SendWait("{ENTER}") to simulate someone
pressing enter to accept the dialog. This had unsatisfactory results.

Can anyone help?

Thanks in advance