Yes - you can use ADO to write to a closed workbook. You haven't given any details to work with so here's a generic example:
![]()
Sub ExportDataFromThisWorkbookToClosedWorkbook() ' Sample demonstrating how to export data from the current workbook to a closed workbook Dim cn As Object Dim strQuery As String Set cn = CreateObject("ADODB.Connection") With cn .Provider = "Microsoft.ACE.OLEDB.12.0" .ConnectionString = "Data Source=" & ActiveWorkbook.FullName & ";" & _ "Extended Properties=""Excel 12.0;HDR=Yes;""" .Open End With strQuery = "INSERT INTO [Sheet1$] IN '' [Excel 8.0;Database=C:\ADO Dest.xls] SELECT * FROM [Sheet1$B2:F3]" cn.Execute strQuery cn.Close Set cn = Nothing End Sub
Bookmarks