以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  导入的一些疑问  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=123944)

--  作者:zaq3574020
--  发布时间:2018/8/27 17:20:00
--  导入的一些疑问
Dim dlg As New OpenFileDialog \'定义一个新的OpenFileDialog
dlg.Filter= "Excel文件(*.xls)|*.xls|Excel文件(*.xlsx)|*.xlsx" \'设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then \'如果用户单击了确定按钮    
    Dim mg As New Merger   
    mg.SourcePath = dlg.FileName
    If dlg.FileName.EndsWith(".xls")       
        mg.Format = "excel" \'指定格式        
    Else        
        mg.Format = "excel2007" \'指定格式       
    End If   
    mg.SourceTableName = "花色$"   
    mg.DataTableName = "花色"   
    mg.Merge()  
End If

mg.SourceTableName = "花色$"   这个有没有办法动态指定不要写死
还有就是mg.DataTableName = "花色"   怎么指定关联表格 例如:入库主表.入库明细 

--  作者:有点甜
--  发布时间:2018/8/27 17:36:00
--  

参考

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=101056&skin=0