M
MikeFromEurope
According to MS, the /automation switch for Excel disables all
automatically opened files and auto-run macros. You get this feature
when starting Excel like "excel.exe /automation". But, I am starting
Excel from a C# program, not a command line, and I am having issues
with auto-run macros. How can I disable the auto-run macros when
actually automating Excel? A snippet of my code is below.
Thanks,
Mike
*************
MSExcel.Application app = new MSExcel.Application();
try
{
app.Workbooks.Open(filePath, Missing.Value, Missing.Value,
Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value,
Missing.Value);
...
}
automatically opened files and auto-run macros. You get this feature
when starting Excel like "excel.exe /automation". But, I am starting
Excel from a C# program, not a command line, and I am having issues
with auto-run macros. How can I disable the auto-run macros when
actually automating Excel? A snippet of my code is below.
Thanks,
Mike
*************
MSExcel.Application app = new MSExcel.Application();
try
{
app.Workbooks.Open(filePath, Missing.Value, Missing.Value,
Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value,
Missing.Value);
...
}