c#写入日期信息到excel中
来源:互联网 发布:极乐净土相机数据 编辑:程序博客网 时间:2024/05/23 13:32
object Nothing = System.Reflection.Missing.Value;
var app = new Excel.Application();
app.Visible = false;
Excel.Workbook mybook = app.Workbooks.Open(filenameExcel, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing);
var app = new Excel.Application();
app.Visible = false;
Excel.Workbook mybook = app.Workbooks.Open(filenameExcel, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing);
Excel.Worksheet mysheet = (Excel.Worksheet)mybook.Worksheets[1];
mysheet.Activate();
mysheet.Cells[row, 1].NumberFormatLocal = "@"; //日期格式设置为 文本 类型,否则写入excel后,小数位的秒会被截断
mysheet.Cells[row, 1] = time;//time= 2015-08-07 10:24:49.079
//所有信息写入excel完成后
mybook.Save();
mybook.Close(false, Type.Missing, Type.Missing);
mybook = null;
//quit excel app
app.Quit();
0 0
- c#写入日期信息到excel中
- c#写入数据到excel中
- 写入资料到EXCEL中
- c# 数据库的写入到excel
- c# 写入数据到excel文件
- c# 将指定的信息导出到eXcel文件中,
- C# winform中导出数组等信息到excel
- PHP 写入资料到EXCEL中
- DataTable 的数据写入到 Excel中
- 将Excel数据写入到TXT中
- 海量数据写入到Excel中
- 将datatable相关内容写入到excel中
- C#在excel中写入数据
- c#怎样往excel中写入数据
- 用C#将数据写入到Excel指定的单元格中
- XML:将信息写入到XML中
- C#学习笔记:c# 从EXCEL 读取信息并保存到dataset中
- 在后台日志中写入信息-输出信息到log
- 字符逆序
- HDU 3706 单调队列
- HDU1598-find the most comfortable road
- linux系统时间问题
- 浅谈PHP中6种GET和POST请求发送方法
- c#写入日期信息到excel中
- 用Java实现文件上传
- c++ windows程序崩溃生成转储dump
- 黑马程序员——————java基础
- unity3d 小地图的实现 脚本代码
- 非URL转发实现域名跳转
- 九度oj 1062
- Lua语言基础
- intellij idea 公众号开发 微信自定义菜单 中文乱码 问题的解决