编程教程
您现在的位置: 中国个人站长站 >> 网络编程 >> ASP.NET教程 >> 教程正文 vb 中 创建的EXCEL 对象无法在WIN98中office2000中显示(在XP的OFFICE2000中可以)
推荐位

vb 中 创建的EXCEL 对象无法在WIN98中office2000中显示(在XP的OFFICE2000中可以)

中国个人站长站 ASP.NET教程 点击数: 更新时间:2007-7-10 8:51:20

我用的是DAO   将data中的数据导入到自己创建的Excel    对象中去

Sub TableToExcel(nTableName As Integer, nTableData() As Integer)
    FrmQuarterTable.MousePointer = 11
    On Error Resume Next
    Dim i As Integer
    Dim j As Integer
    Dim strYear As String
    Dim strSeason As String
    Dim xlApp, xlBook, xlSheet As Object
    On Error Resume Next
    Set xlApp = CreateObject("Excel.Application")
    Set xlBook = xlApp.Workbooks.Add
    Set xlsheet1 = xlBook.worksheets(1)
    xlApp.activewindow.tabratio = 0.9
    Select Case nTableName
        Case 11:
            xlBook.worksheets("sheet1").Select
            xlApp.activesheet.range("B1:H1").Select
            xlApp.activecell.formular1c1 = "表1-1  "             

            xlApp.selection.Font.Name = "黑体"
            xlApp.selection.Font.FontStyle = "Bold"
            xlApp.selection.Font.Size = 18
            xlApp.selection.merge
            With xlApp.activesheet.range("a2:i13").Borders  '边框设置
               .LineStyle = 1       'xlBorderLineStyleContinuous
               .ColorIndex = 5                          '边框为黑色=1

蓝色=5
               .Weight = 2                              'xlthin
            End With
            With xlBook.worksheets("sheet1")
                .cells(2, 3) = "新病人(1)": .cells(2, 4) = "复发(2)":

.cells(2, 5) = "追回(3)":

                 .cells(2, 6) = "初治失败(4)": .cells(2, 7) = "迁入

(5)":

                .cells(2, 8) = "其他(6)": .cells(2, 9) = "合计(7)"
                .cells(3, 2) = "初治": .cells(6, 2) = "初治": .cells(9,

2) = "初治"
                .cells(4, 2) = "复治": .cells(7, 2) = "复治": .cells

(10, 2) = "复治"
                .cells(5, 2) = "小计": .cells(8, 2) = "小计": .cells

(11, 2) = "小计"
                .cells(2, 1) = "    ": .range("a2:b2").Select:

xlApp.selection.merge
                .cells(3, 1) = "涂阳": .range("a3:a5").Select:

xlApp.selection.merge
                .cells(6, 1) = "涂阴": .range("a6:a8").Select:

xlApp.selection.merge
                .cells(9, 1) = "未查痰": .range("a9:a11").Select:

xlApp.selection.merge
                .cells(12, 1) = "胸膜炎": .range("a12:b12").Select:

xlApp.selection.merge
                .cells(13, 1) = "其他": .range("a13:b13").Select:

xlApp.selection.merge
                .Columns("f:f").columnwidth = 13
                .range("A1:i13").Select
                With xlApp.selection
                    .HorizontalAlignment = -4108                '水平居


                    .VerticalAlignment = -4108                  '垂直居


                End With
                For i = 3 To 13
                    For j = 3 To 9
                        .cells(i, j) = nTableData(i - 1, j)
                    Next
                Next
            End With
        Case 12:   ...............

       case 13: .....................

     end select

     For i = 0 To 12
             For j = 0 To 11
                     nTableData(i, j) = 0
            Next
     Next
    xlApp.Visible = True
    FrmQuarterTable.MousePointer = 1

End Sub

 

                 急盼高手指教!!。。  wolf_coming@126.com

                                        QQ   15433677
           

 

教程录入:swh    责任编辑:swh 
个人站长站与你风雨同舟!
本站所提供的资源均来源于互联网,如有侵权行为,请与本站管理员联系,我们会第一时间删除!
·如果您发现《vb 中 创建的EXCEL 对象无法在WIN98中office2000中显示(在XP的OFFICE2000中可以)》文章有错误,也请通知我们修改!
联系邮箱chinageren#126.com,谢谢支持!
站内搜索:
广告服务 | 友情链接 | 联系我们 | 免责声明 | 用户留言 | 网站导航
版权所有:中国个人站长站 2007-2008 未经授权禁止复制或建立镜像 客服QQ号:112731235
copyright © 2007-2008 www.ChinaGeRen.com online services. all rights reserved. 苏ICP备05000059号