public void AddInput(string value, IElement element) { try { var old = Activity as Activities.ReadCell <string>; double d; var isDouble = double.TryParse(value, out d); int i; var isInt = int.TryParse(value, out i); if (isInt) { var a = new Activities.WriteCell <int> { DisplayName = old.DisplayName }; a.Cell = old.Cell; a.Filename = old.Filename; a.Value = i; Activity = a; } else if (isDouble) { var a = new Activities.WriteCell <double> { DisplayName = old.DisplayName }; a.Cell = old.Cell; a.Filename = old.Filename; a.Value = d; Activity = a; } else { var a = new Activities.WriteCell <string> { DisplayName = old.DisplayName }; a.Cell = old.Cell; a.Filename = old.Filename; a.Value = value; Activity = a; } var app = Activities.officewrap.application; var workbook = app.ActiveWorkbook; // if (workbook == null) workbook = app.ThisWorkbook; if (workbook == null) { return; } var worksheet = workbook.ActiveSheet as Microsoft.Office.Interop.Excel.Worksheet; var c = old.Cell.Expression.ToString(); Microsoft.Office.Interop.Excel.Range range = worksheet.get_Range(c); range.Value2 = value; } catch (Exception ex) { Log.Error(ex.ToString()); } }
public void AddInput(string value, IElement element) { var old = Activity as Activities.ReadCell <string>; var a = new Activities.WriteCell <string> { DisplayName = old.DisplayName }; a.Cell = old.Cell; a.Filename = old.Filename; a.Value = value; Activity = a; }
public void AddInput(string value, IElement element) { try { var old = Activity as Activities.ReadCell <string>; var a = new Activities.WriteCell <string> { DisplayName = old.DisplayName }; a.Cell = old.Cell; a.Filename = old.Filename; a.Value = value; Activity = a; } catch (Exception ex) { Log.Error(ex.ToString()); } }