I am attempting to add a couple of new columns to an excel file. I can add the column pretty easily, but I can't figure out how to add a column header to the excel file. How on earth do you add a column header to a newly added column? Here is how I add 3 new columns to a An excel worksheet.
Range rng = (Range)wkSheet.get_Range("A1", Type.Missing);
rng.EntireColumn.Insert(XlInsertShiftDirection.xlShiftToRight,
XlInsertFormatOrigin.xlFormatFromRightOrBelow);
Range rng2 = (Range)wkSheet.get_Range("A1", Type.Missing);
rng2.EntireColumn.Insert(XlInsertShiftDirection.xlShiftToRight,
XlInsertFormatOrigin.xlFormatFromRightOrBelow);
Range rng3 = (Range)wkSheet.get_Range("A1", Type.Missing);
rng3.EntireColumn.Insert(XlInsertShiftDirection.xlShiftToRight,
XlInsertFormatOrigin.xlFormatFromRightOrBelow);
wkSheet.SaveAs("C:\\Code\\UPMC\\ISD\\EADIS\\UPMC.ISD.EADIS.ACO.ACOBackLoad\\App_Data\\test", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);