Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Excelеtest.xls;Extended Properties=Excel 8.0"
Dim ExcelConnection As New adodb.Connection
ExcelConnection.Open ConnectionString
Dim SQLCommand As String
SQLCommand = "CREATE TABLE sheet1 (ID INTEGER, Field1 TEXT(50), Field2 TEXT(50), Field3 TEXT(50))"
Dim Cmd As New adodb.Command
cmd.ActiveConnection = ExcelConnection
cmd.CommandText = SQLCommand
Cmd.Execute
|