using Excel = Microsoft.Office.Interop.Excel;
Excel.Range r = sheet.get_Range(ExcelAssistant.c1ToA(Column_Date + i) + Row_Date_Insert, ExcelAssistant.c1ToA(Column_Date + i) + (Row_Date_Insert + sheet.UsedRange.Rows.Count));
Console.WriteLine("range r property" + r.Address);
r.Insert(Excel.XlInsertShiftDirection.xlShiftToRight,Missing.Value);
r.Insert();
sheet.Columns[Column_Date + i].insert();
ExcelAssistant is an Excel Util class and it has static method c1ToA to transfer the interger of the column number into the "ABC" Format.
I use the Console.WriteLine to ensure I point to correct position.
Then I tried several insert method above but none works.
What' wrong?
Any help may be appreciated.
r.EntireColumn.Insert()r.Address?Console.WriteLine(r.Parent.Name)to see whether you are refering the correct worksheet.