Foxtable(狐表)用户栏目专家坐堂 → 文件名问题


  共有1395人关注过本帖树形打印复制链接

主题:文件名问题

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/8/7 16:47:00 [显示全部帖子]

Dim dlg As New OpenFileDialog
dlg.Filter= "Excel文件|*.xls|Word文件|*.doc|Access文件|*.mdb"
If dlg.ShowDialog = DialogResult.Ok Then
    Dim book As new XLS.Book(dlg.FileName)
    Dim flag As Boolean = False
    For Each sheet As XLS.Sheet In book.Sheets
        If sheet.name = "sheet1" Then
            flag = True
        End If
    Next
    If flag Then
        Dim ip As New Importer
        ip.SourcePath = dlg.FileName
        ip.SourceTableName = "sheet1$"
        ip.NewTableName ="距离"
        ip.Format = "Excel"
        ip.Import()
    Else
        msgbox("不存在sheet1")
    End If
End If

 回到顶部