首页 > 开发 > 综合 > 正文

怎样将datagrid中数据到处到&#101xecl中

2024-07-21 02:23:28
字体:
来源:转载
供稿:网友
1 引入microsoft excel 10.0 object library
(项目->添加引用->com)
2 dim excelapp as new excel.application
dim excelbook as excel.workbook
dim excelsheet as excel.worksheet
3 set excelbook = excelapp.workbooks.open (app.path & "/工程进度表.xls")
excelapp.sheets("sheet1").select
set excelsheet = excelapp.sheets("sheet1")
4 excelsheet.cells(2, 1) = ....
5 excelbook.save
excelapp.visible = true
6 excelsheet.columns(i).columnwidth = 5.38
excelsheet.rows(i).rowheight = 51
7 set excelapp = nothing
set excelbook = nothing
set excelsheet = nothing
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表