Код: Выделить всё
private void BW_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{ // This is the worker thread-completed code
ExcelAsyncUtil.QueueAsMacro(() =>
{
string[] outputs = (string[])e.Result;
if (outputs.Length < 1)
{
MessageBox.Show("Unable to retrieve result", title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
Common.ExitToExcel();
return;
}
ExcelDna.Integration.dll!ExcelDna. Integration.ExcelAsyncUtil.QueueAsMacro(ExcelDna.Integration.ExcelAction action) Неизвестно
Выброшено исключение: «System.NullReferenceException» в
ExcelDna.Integration.dll Необработанное исключение типа
«System.NullReferenceException» произошло в ExcelDna.Integration.dll
Ссылка на объект не установлена на экземпляр объекта .
Excel открывается через Excel Interop, когда эта ошибка возникает в тестовом режиме
Код: Выделить всё
xl.Application excelApp = new xl.Application(); //open an Excel application with the given workbook
xl.Workbook workbook = excelApp.Workbooks.Open(filepath);
Подробнее здесь: https://stackoverflow.com/questions/792 ... automation
Мобильная версия