public static async void Worksheet_SelectionchangeAsync(Excel.Range Target) { string val = ""; await Task.Delay(10000); Excel.Application XlApp = Globals.ThisAddIn.Application; //excelApp = new Excel.ApplicationClass(); //excelApp.Visible = true; // System.Threading.Thread.Sleep(10000); string cellAdd = XlApp.ActiveCell.Left.ToString(); Excel.Worksheet ws = (Excel.Worksheet)XlApp.ActiveWorkbook.ActiveSheet; int row = Target.Row; int col = Target.Column; var cell1 = Target.Value2; Excel.Range cell = (Excel.Range)ws.Cells[row, col]; Excel.Range r = (Excel.Range)XlApp.Selection; var cell11 = r.Value2;// x.Cells[4, 7]; // null reference error( debugger function requires all threads to run) // XlApp.Cells[1, 1] = cell.Value2; // null reference ( debugger function requires all threads to run) string i = (Globals.ThisAddIn.Application.Cells[row, col] as Excel.Range).Value2.ToString() ; XlApp.EnableEvents = false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)