You need ADOX to do it.
This is how you would create the excel file
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Dim col As ADOX.Column
Set cat = New ADOX.Catalog
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source="
& myfile & ";Extended Properties=Excel 8.0"
Set tbl = New ADOX.Table
tbl.Name = "Sample"
'do this for each column in the table
Set col = New ADOX.Column
With col
.Name = "myTipe"
.Type = adVarWChar
.DefinedSize = 80
End With
tbl.Columns.Append col
....
You can then open the file with ADO to write your info
--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
wrote in message news:5207082@discussion.autodesk.com...
Hello.
How créate a ADO connection for create un file .XLS ?
I know how read a existing file XLS.
SQL command : SELEC * ... but if i use CREATE TABLE...
the vba say : the file open only in read.
dim strfile as string
Dim cnn As New ADODB.Connection
dim rs as new ADODB.Recordset
strfile=c:\mynewfile.xls
cnn.ConnectionString = "Driver={Microsoft Excel Driver (*.xls)};DBQ=" &
strfile"
cnn.open
rs.open "Create table ..."
How create a file .XLS without the excel application ?