如何在VS2010用vb语言做一个类似Excel的表格
如何在VS2010用vb语言做一个类似Excel的表格,最好能把里面的数输出成折线图的之类的就更好了...
如何在VS2010用vb语言做一个类似Excel的表格,最好能把里面的数输出成折线图的之类的就更好了
展开
1个回答
展开全部
VS 软件太大,我没有安装 ,VB6中是可以的,供参考
Dim objExcel As Excel.Application
Dim objWorkBook As Excel.Workbook
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Add()
objExcel.Visible = False
Dim objSheet As Excel.Worksheet
Set objSheet = objExcel.Worksheets("sheet1")
objSheet.Cells(1,1) = "姓名" '对单元格赋值
objSheet.Cells(1,2) = Date
objSheet.Cells(1,3) = Time
objWorkBook.SaveAs App.Path & "\a.xls" '保存
objWorkBook.Close
objExcel.Quit
Set objSheet = Nothing
Set objWorkBook = Nothing
Set objExcel = Nothing
Dim objExcel As Excel.Application
Dim objWorkBook As Excel.Workbook
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Add()
objExcel.Visible = False
Dim objSheet As Excel.Worksheet
Set objSheet = objExcel.Worksheets("sheet1")
objSheet.Cells(1,1) = "姓名" '对单元格赋值
objSheet.Cells(1,2) = Date
objSheet.Cells(1,3) = Time
objWorkBook.SaveAs App.Path & "\a.xls" '保存
objWorkBook.Close
objExcel.Quit
Set objSheet = Nothing
Set objWorkBook = Nothing
Set objExcel = Nothing
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询