public void Execute(Arguments arguments) { try { ExcelWrapper excelWrapper = ExcelManager.CreateInstance(); excelWrapper.Open(arguments.Path?.Value, arguments.Sheet?.Value, !arguments.InBackground.Value); Scripter.Variables.SetVariableValue(arguments.Result.Value, new Language.IntegerStructure(excelWrapper.Id)); } catch (Exception ex) { throw new ApplicationException($"Problem occured while opening excel instance. Path: '{arguments.Path.Value}', Sheet: '{arguments.Sheet?.Value}', InBackground: '{arguments.InBackground.Value}'", ex); } }
public void Execute(Arguments arguments) { try { ExcelWrapper excelWrapper = ExcelManager.CreateInstance(); excelWrapper.Open(arguments.Path?.Value, arguments.Sheet?.Value, !arguments.InBackground.Value); Scripter.Variables.SetVariableValue(arguments.Result.Value, new IntegerStructure(excelWrapper.Id)); } catch (Exception ex) { if (ex.GetType() == typeof(COMException) && ex.Message.Contains("80040154")) { throw new Exception("Could not find Microsoft Office on computer. Please make sure it is installed and try again."); } throw new ApplicationException($"Problem occured while opening excel instance. Path: '{arguments.Path?.Value}', Sheet: '{arguments.Sheet?.Value}', InBackground: '{arguments.InBackground.Value}'", ex); } }