Sujeet Raman

Sujeet Raman

  • 859
  • 927
  • 357.5k

How to Write An Array To An Excel Worksheet in c# interoperability

Dec 10 2021 9:33 AM

I have created an excelsheet using interoperabilty.I need to add array in to the first position and all other column need to move

this is how i tried and not working.any way?

Excel.Range rng = xlWorkSheet.get_Range("A1", misValue);
string[] result = File.ReadAllLines(path);
rng.Value2 = result;
rng.EntireColumn.Insert(Excel.XlInsertShiftDirection.xlShiftToRight,
         Excel.XlInsertFormatOrigin.xlFormatFromRightOrBelow);

 


Answers (2)