Format the cell as a text range. NumberFormatLocal = "@"; Get more than one range of cells in Excel: In this case, Excel header range = (range) worksheet.get_range ("A1", "E1"); Cell merge Action range. Merge (0); Excel cell Assignment worksheet.cells[1, 1] = "Excel cell assignment"; Sets the font size range. Font.Size = 15; Sets whether the font has an underscore range. Font.underline=true; Sets the kind of font range. Font.name= "Blackbody"; Sets the way the font is within a cell by range. Horizontalalignment=xlhalign.xlhaligncenter; Sets the width range of the cell. columnwidth=15; Sets the background color range for the cell. Cells.interior.color=system.drawing.color.fromargb (255,204,153). ToArgb (); Sets the thickness range of the cell border. borders.linestyle=1; Adds a border range to the cell. Borderaround (xllinestyle.xlcontinuous, Xlborderweight.xlthick,xlcolorindex.xlcolorindexautomatic, System.Drawing.Color.Black.ToArgb ()); Automatically adjusts the column width range. Entirecolumn.autofit (); Text horizontal centered way range.horizontalalignment= xlcenter; Text Vertical Center mode range.verticalalignment= xlcenter//text wrap range.wraptext=true; Fill color is lavender range.interior.colorindex=39; Font Color RANGE.FONT.COlor=clblue; Save Excel, do not pop up whether to save the window directly to save Xlsapp.displayalerts=false;