Foxtable(狐表)用户栏目专家坐堂 → 求助!关于Excel报表的导出问题


  共有2361人关注过本帖平板打印复制链接

主题:求助!关于Excel报表的导出问题

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/8/1 9:31:00 [只看该作者]

Dim fl As String = "d:\test.xls"

Tables("表A").SaveExcel(fl, "12345")
Dim Book As New XLS.Book(fl)
Dim s As XLS.Sheet = book.Sheets("12345")

For j As Integer = 0 To s.Cols.Count - 1
    If s(0, j).Text = "第一列" Then
        For i As Integer = 1 To s.Rows.Count - 1
            If s(i, j).Text = "0" Then
                s(i, j).Value = "AAA"
            ElseIf s(i, j).Text = "1" Then
                s(i, j).Value = "BBB"
            End If
        Next
    End If
Next
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()


 回到顶部