Exemplo n.º 1
0
        public void AutoOpen()
        {
            try
            {
                Application.ThreadException += ApplicationThreadUnhandledException;
                AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException;
                TaskScheduler.UnobservedTaskException      += TaskSchedulerUnobservedTaskException;
                ExcelIntegration.RegisterUnhandledExceptionHandler(ExcelUnhandledException);

                _log = Log.Logger = ConfigureLogging();
                _log.Information("Starting sample Excel-DNA Add-In with Serilog Sink LogDisplay");

                ExcelComAddInHelper.LoadComAddIn(this);

                _log.Verbose("Registering functions");

                ExcelRegistration.GetExcelFunctions()
                .Select(UpdateFunctionAttributes)
                .RegisterFunctions();

                _log.Information("Sample Excel-DNA Add-In with Serilog Sink LogDisplay started");
            }
            catch (Exception ex)
            {
                ProcessUnhandledException(ex);
            }
        }
Exemplo n.º 2
0
        public void AutoOpen()
        {
            ExcelIntegration.RegisterUnhandledExceptionHandler(ErrorHandler);

            try {
                com_addin = new MyCom();
                ExcelComAddInHelper.LoadComAddIn(com_addin);
            } catch (Exception e) {
                MessageBox.Show("Error loading COM AddIn: " + e.ToString());
            }
        }
Exemplo n.º 3
0
 public void AutoOpen()
 {
     ExcelIntegration.RegisterUnhandledExceptionHandler(ex => "!!! EXCEPTION: " + ex.ToString());
     ComServer.DllRegisterServer();
     try
     {
         _comAddin = new qXLComAddIn();
         ExcelComAddInHelper.LoadComAddIn(_comAddin);
     }
     catch (Exception ex)
     {
         MessageBox.Show(@"Error loading COM AddIn: " + ex);
     }
 }
        public void Register()
        {
            if (FunctionRegistration != null)
            {
                ExcelRegistration.RegisterFunctions(FunctionRegistration.GetFunctionRegistrations());
            }

            if (RibbonRegistration != null)
            {
                foreach (var addIn in RibbonRegistration.GetRibbonAddIns())
                {
                    ExcelComAddInHelper.LoadComAddIn(addIn);
                }
            }
        }
Exemplo n.º 5
0
        public void AutoOpen()
        {
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Verbose()
                         .Enrich.WithXllPath()
                         .Enrich.WithExcelVersion()
                         .Enrich.WithExcelVersionName()
                         .Enrich.WithExcelBitness()
                         .WriteTo.ExcelDnaLogDisplay(displayOrder: DisplayOrder.NewestFirst,
                                                     outputTemplate: "{Properties:j}{NewLine}[{Level:u3}] {Message:lj}{NewLine}{Exception}")
                         .CreateLogger();

            Log.Information("Hello from {AddInName}! :)", DnaLibrary.CurrentLibrary.Name);
            LogDisplay.Show();

            ExcelComAddInHelper.LoadComAddIn(this);
        }
Exemplo n.º 6
0
        public void AutoOpen()
        {
            RegisterFunctions();

            // setup error handler
            ExcelIntegration.RegisterUnhandledExceptionHandler(ex => ex.ToString());

            var app = ExcelDnaUtil.Application as Microsoft.Office.Interop.Excel.Application;

            app.RTD.ThrottleInterval = 100;

            //Open the client connection
            ConnectionMonitor = new ConnectionMonitor();
            ConnectionMonitor.RegisterClient(Client);
            ExcelComAddInHelper.LoadComAddIn(new ComAddIn(Client, ConnectionMonitor));

            //Start the monitor
            ConnectionMonitor.FindAvailableServicesAsync().ContinueWith(result =>
            {
                ConnectionMonitor.Start();
            });
        }
Exemplo n.º 7
0
 public override void LoadComAddIn(ExcelComAddIn addIn)
 {
     ExcelComAddInHelper.LoadComAddIn(addIn);
 }