请问如何读写EXCEL表中的数据
解决方案 »
- 简单的字符串连接问题
- 想把picturebox控件中所画的线条存成16色的BMP位图如何怎样实现?
- 50分在线问:data Report控件中能对Label标签控件赋值吗?
- 一个中小学排课系统,数据库该如何设计。
- 扩展名是iso的压缩包用什么解开?
- 关于用mcisendstring播放VCD格式文件时的问题
- 新手入门,如何得到一文件的路径!
- 推荐人大经济论坛,国内最大的经管类资源下载、知识交流的网站,网址:http://www.pinggu.org/bbs
- sFileNames = Split(cd.FileName, Chr(32))中的SPLIT 是什么函数
- MDAC_TYP的命令行参数??
- datagrid控键如何禁止某行编辑
- 如何使用API 的PIE 和 SetBkColor 画出一个扇形?
Dim xlBook As New Workbook
Dim xlSheet As New Worksheet
Set xlteachder = CreateObject("excel.application")
xlteachder.Visible = False/true 是否可见
Set xlBook = xlteachder.Workbooks.Open(地址)
Set xlSheet = xlBook.Worksheets(1)
xxxx=xlSheet.Cells(1,1)Value 就是第一行地一列的值
xlSheet.Cells(1,1)Value=xxxx 也可以赋值
xlBook.Save 改变以后一定要保存
xlteachder.Quit
xlteachder.Workbooks.Close '关闭进程
Dim ExcelBook As Excel.Workbook
Dim ExcelSheet As Excel.Worksheet
Set ExcelApp = CreateObject("excel.application") '创建EXCEL句柄
ExcelApp.Visible = False '
Set ExcelBook = ExcelApp.Workbooks.Add '创建EXCEL工作薄
Set ExcelSheet = ExcelBook.Worksheets(1) '创建EXCEL工作表
ExcelSheet.Cells(1, 1).Value = "编号"
ExcelSheet.Cells(1, 2).Value = "单位名称"
ExcelSheet.Cells(1, 3).Value = "负责人"
ExcelSheet.Cells(1, 4).Value = "单位地址"
ExcelSheet.Cells(1, 5).Value = "类别"
ExcelSheet.Cells(1, 6).Value = "许可项目"
ExcelSheet.Cells(1, 7).Value = "区域"
ExcelSheet.Cells(1, 8).Value = "乡镇"
ExcelSheet.Cells(1, 9).Value = "发证日期"
ExcelSheet.Cells(1, 10).Value = "截止日期"
ExcelSheet.Range("A2").CopyFromRecordset rsExcelBook.SaveAs strExcelPath + "临时卫生许可证报表"
ExcelApp.Visible = True
vb正在学习,关注中!~~~