0

I am trying to open an Excel with C# using:

using Excel = Microsoft.Office.Interop.Excel;
ExcelApplication = new Excel.Application { Visible = true };

The problem is that Excel will open without default add-ins.

And when I open my excel manually, I have all my default add-ins.

Do you know how can I open directly this addins when Excel is opening? I am not supposed to open this add-ins like Workbooks.Open( .... xll) but directly at opening because my application is not supposed to manage add-ins from the code.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Alex
  • 21
  • 1
  • How about simply using [`Process.Start`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.start)? – Uwe Keim Sep 28 '21 at 16:19
  • Can I disable excel alert with process.start? I know we can do it using ExcelApplication.DisplayAlerts = false; but I need to use new Excel.Application. – Alex Sep 28 '21 at 16:21
  • I don't think so. Take a look by yourself for available [Excel command line switches](https://support.microsoft.com/en-us/office/command-line-switches-for-microsoft-office-products-079164cd-4ef5-4178-b235-441737deb3a6#Category=Excel). – Uwe Keim Sep 29 '21 at 05:54

1 Answers1

1

If you want to load a specific add-in you can follow the approach here. To load Excel as normal using Process.Start as Uwe suggested, try here - this gives you a COM object which you can call DisplayAlerts on.

stevecu
  • 336
  • 2
  • 7