2
Answers

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

Sujeet Raman

Sujeet Raman

3y
914
1

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)