Dim dlg As New FolderBrowserDialog
dlg.SelectedPath = Vars("path")
If dlg.ShowDialog = DialogResult.Ok Then
Vars("path") = dlg.SelectedPath
For Each file As String In filesys .GetFiles(dlg.SelectedPath)
Dim Value As String = filesys.GetName(file)
If value.Contains("创建结构.xls") Then
Dim Book As New XLS.Book(file)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim a1 As String = sheet(0,0).Text
Dim Builder As New ADOXBuilder
Dim tbl As ADOXTable
Builder.Open()
tbl = Builder.NewTable(a1) '创建表
With tbl
Dim i As Integer
For i = 1 To 20
Dim a2 As String = sheet(i,0).text
Dim b2 As String = sheet(i,1).text
Dim c2 As String = sheet(i,2).text
If a2 = Nothing Then
Continue For
End If
.AddColumn(a2,ADOXType.String, c2)
Next
Builder.AddTable(tbl) '增加表
Builder.Close()
End With
End If
Next
End If
Syscmd.Project.Open(ProjectFile)