Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
Dim xlApp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
Dim strSource, strDestination As String
Dim App As Excel.Application xlApp = New Excel.Application
xlApp = CreateObject("Excel.Appliction") ‘无法创建 ActiveX 组件。 xlApp.Visible = False
xlbook = xlApp.Workbooks.Open(App.Path & "\selectcp.xls")
xlsheet = xlbook.Worksheets(1)
strSource = "F:\管理程序集2011.04.12\UserMaster\UserMaster\excel模板\selectcp"
strDestination = "F:\管理程序集2011.04.12\UserMaster\UserMaster\excel模板\selectlscp" FileCopy(strSource, strDestination)
xlsheet.Activate()
xlsheet.Cells(4, 5) = I1.Text
xlbook.Save()
xlsheet.PrintOut()
xlApp.Quit()什么原因,求正解!!!
Dim xlApp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
Dim strSource, strDestination As String
Dim App As Excel.Application xlApp = New Excel.Application
xlApp = CreateObject("Excel.Appliction") ‘无法创建 ActiveX 组件。 xlApp.Visible = False
xlbook = xlApp.Workbooks.Open(App.Path & "\selectcp.xls")
xlsheet = xlbook.Worksheets(1)
strSource = "F:\管理程序集2011.04.12\UserMaster\UserMaster\excel模板\selectcp"
strDestination = "F:\管理程序集2011.04.12\UserMaster\UserMaster\excel模板\selectlscp" FileCopy(strSource, strDestination)
xlsheet.Activate()
xlsheet.Cells(4, 5) = I1.Text
xlbook.Save()
xlsheet.PrintOut()
xlApp.Quit()什么原因,求正解!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货