oSheet.get_Range("A1","N4").Font.Size= 9 ;
oSheet.get_Range("A1","N4").Font.Bold = true;
oSheet.get_Range("A1","N4").VerticalAlignment = Excel.XlVAlign.xlVAlignCenter;
oSheet.get_Range("A1","N4").HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
//该范围内设置外面一层边框
oSheet.get_Range("A1","N4").BorderAround(Excel.XlLineStyle.xlContinuous,Excel.XlBorderWeight.xlThin ,Excel.XlColorIndex.xlColorIndexAutomatic,Color.Black.ToArgb()) ; //该范围内设置里面所有单元格的边框
oSheet.get_Range("A1","N4").Borders.Weight = Excel.XlBorderWeight.xlThin ;
oSheet.get_Range("A1","N4").Borders.Color = Color.Black.ToArgb() ;
//范围内单元格添加背景颜色
oSheet.get_Range("A1","N2").Cells.Interior.Color =Color.FromArgb(153,255,204).ToArgb();
oSheet.get_Range("A1","N2").Cells.Interior.Pattern = Excel.XlBackground.xlBackgroundAutomatic ;
oSheet.get_Range("A1","N4").Font.Bold = true;
oSheet.get_Range("A1","N4").VerticalAlignment = Excel.XlVAlign.xlVAlignCenter;
oSheet.get_Range("A1","N4").HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
//该范围内设置外面一层边框
oSheet.get_Range("A1","N4").BorderAround(Excel.XlLineStyle.xlContinuous,Excel.XlBorderWeight.xlThin ,Excel.XlColorIndex.xlColorIndexAutomatic,Color.Black.ToArgb()) ; //该范围内设置里面所有单元格的边框
oSheet.get_Range("A1","N4").Borders.Weight = Excel.XlBorderWeight.xlThin ;
oSheet.get_Range("A1","N4").Borders.Color = Color.Black.ToArgb() ;
//范围内单元格添加背景颜色
oSheet.get_Range("A1","N2").Cells.Interior.Color =Color.FromArgb(153,255,204).ToArgb();
oSheet.get_Range("A1","N2").Cells.Interior.Pattern = Excel.XlBackground.xlBackgroundAutomatic ;
但我不知道单元个对象的类型,即Cells[n,n]是什么类型的,它有哪些属性
我希望自定义一个公式存放在Range对象的属性中,但好象没有相应的属性可以供我使用,Range.Formula属性又不认我的公式,使得显示的是“#NAME?”文本(我希望是空白),请问有没有办法把我自定义的公式保存在Excel文件(*.xls)中