Archive for October, 2013

dont use a messagebox while start for your addin

sometime its very usefull in development to bring a message in front for debugging or diagnostics.
typical is a messagebox in OnConnection or OnStartupComplete but ist not a good idea to this.
the problem occurs when you create a new office instance programaticly(or anyone else).
let see:

// c#
Excel.Application app = new Excel.Application();

if you run this code, a new instance is created and the instance load all loadonstartup addins and is ready to go after them. but now we block this process with a messagebox in OnConnection or OnStartupComplete. the example code throws a component creation error(timeout) in this case. For this reason, the next NetOffice release includes some compatible dialogs and a messagebox without blocking the process(pseudo-modal). Office doesnt spend a safe notification feature or not? any kind of method like Alert or something like that available in Office?


Categories: Allgemein