Is it possible to open up an excel spreadsheet and populate it with the contents of a recordset?
Printable View
Is it possible to open up an excel spreadsheet and populate it with the contents of a recordset?
then you can do rs.addnew to add your records to the sheetCode:'uses ado 2.1 or higher
Dim cn As New Connection
Dim rs As New Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Test.xls;Extended Properties=Excel 8.0;"
'excel sheet name here
'must enclose in brackets, sheet name followed by a dollar sign
rs.Open "Select * from [Sheet1$]", cn, adOpenKeyset, adLockOptimistic