C # operate Automatic Filling of Excel cells, center alignment, and font color settings
// Set the title in Excel. range titlerange = worksheet. get_range (worksheet. cells [1, 1], worksheet. cells [1, columncount]); // select a cell and titlerange of one or more rows. merge (true); // merge the cell titlerange. value2 = strtitle; // set the text titlerange in the cell. font. name = ""; // set the titlerange font. font. size = 18; // font size titlerange. font. bold = true; // bold to show titlerange. horizontalalignment = excel. xlhalign. xlhaligncenter; // titlerange in the horizontal center. verticalalignment = excel. xlvalign. xlvaligncenter; // vertically centered titlerange. borders. linestyle = excel. xllinestyle. xlcontinuous; // set the border titlerange. borders. weight = excel. xlborderweight. xlmedium; // regular Border Width
Reference: http://blog.csdn.net/zhaobisha/article/details/3862568