首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

怎么用c#设置 Excel中的cells的格式设定为“文件列”?

2012-03-09 
如何用c#设置 Excel中的cells的格式设定为“文件列”??((Excel.Range)xlSheet.Cells[m,n])用什么属性?用((Ex

如何用c#设置 Excel中的cells的格式设定为“文件列”??
((Excel.Range)xlSheet.Cells[m,n])   用什么属性?
用((Excel.Range)xlSheet.Cells[m,n]).NumberFormatLocal   =   "@ ";位数对了但格式还是不对,显示的还是3.03E+13这样的显示。


[解决办法]
可以直接用get_range设置一个区域的格式,把
((Excel.Range)xlSheet.Cells[m,n]).NumberFormatLocal = "@ ";
放到给cell付值之前
[解决办法]
worksheet.Rows.NumberFormatLocal = "@ "; //设置所有单元格为文本格式

热点排行